mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-17 01:16:00 +00:00
Modules
This commit is contained in:
13
node_modules/es-abstract/.editorconfig
generated
vendored
Normal file
13
node_modules/es-abstract/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab;
|
||||
insert_final_newline = true;
|
||||
quote_type = auto;
|
||||
space_after_anonymous_functions = true;
|
||||
space_after_control_statements = true;
|
||||
spaces_around_operators = true;
|
||||
trim_trailing_whitespace = true;
|
||||
spaces_in_brackets = false;
|
||||
end_of_line = lf;
|
||||
|
1
node_modules/es-abstract/.eslintignore
generated
vendored
Normal file
1
node_modules/es-abstract/.eslintignore
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
coverage
|
75
node_modules/es-abstract/.eslintrc
generated
vendored
Normal file
75
node_modules/es-abstract/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"env": {
|
||||
"es6": true,
|
||||
},
|
||||
|
||||
"rules": {
|
||||
"arrow-parens": [2, "always"],
|
||||
"array-bracket-newline": 0,
|
||||
"array-element-newline": 0,
|
||||
"complexity": 0,
|
||||
"eqeqeq": [2, "allow-null"],
|
||||
"func-name-matching": 0,
|
||||
"id-length": [2, { "min": 1, "max": 40 }],
|
||||
"max-params": [2, 4],
|
||||
"max-statements": [2, 24],
|
||||
"max-statements-per-line": [2, { "max": 2 }],
|
||||
"multiline-comment-style": 0,
|
||||
"no-magic-numbers": 0,
|
||||
"new-cap": 0,
|
||||
"no-extra-parens": 1,
|
||||
"operator-linebreak": [2, "before"],
|
||||
"sort-keys": 0,
|
||||
},
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "./*/{Date,Month}FromTime.js",
|
||||
"rules": {
|
||||
"max-statements": [2, 30],
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": "operations/*",
|
||||
"rules": {
|
||||
"max-lines": 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": "operations/*.js",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
},
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"no-multi-str": 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": "operations/getOps.js",
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"no-process-exit": 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"id-length": 0,
|
||||
"max-lines": 0,
|
||||
"max-lines-per-function": 0,
|
||||
"max-statements-per-line": [2, { "max": 3 }],
|
||||
"max-nested-callbacks": [2, 4],
|
||||
"max-statements": 0,
|
||||
"no-implicit-coercion": 0,
|
||||
"no-invalid-this": 1,
|
||||
"object-curly-newline": 0,
|
||||
"prefer-regex-literals": 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
472
node_modules/es-abstract/.gitattributes
generated
vendored
Normal file
472
node_modules/es-abstract/.gitattributes
generated
vendored
Normal file
@ -0,0 +1,472 @@
|
||||
2015/AbstractRelationalComparison.js spackled
|
||||
2015/DateFromTime.js spackled
|
||||
2015/Day.js spackled
|
||||
2015/DayFromYear.js spackled
|
||||
2015/DayWithinYear.js spackled
|
||||
2015/DaysInYear.js spackled
|
||||
2015/HourFromTime.js spackled
|
||||
2015/InLeapYear.js spackled
|
||||
2015/IsCallable.js spackled
|
||||
2015/IsPropertyDescriptor.js spackled
|
||||
2015/MakeDate.js spackled
|
||||
2015/MakeDay.js spackled
|
||||
2015/MakeTime.js spackled
|
||||
2015/MinFromTime.js spackled
|
||||
2015/MonthFromTime.js spackled
|
||||
2015/SameValue.js spackled
|
||||
2015/SecFromTime.js spackled
|
||||
2015/StrictEqualityComparison.js spackled
|
||||
2015/TimeClip.js spackled
|
||||
2015/TimeFromYear.js spackled
|
||||
2015/TimeWithinDay.js spackled
|
||||
2015/ToBoolean.js spackled
|
||||
2015/ToInt32.js spackled
|
||||
2015/ToPropertyDescriptor.js spackled
|
||||
2015/ToUint16.js spackled
|
||||
2015/ToUint32.js spackled
|
||||
2015/WeekDay.js spackled
|
||||
2015/YearFromTime.js spackled
|
||||
2015/modulo.js spackled
|
||||
2015/msFromTime.js spackled
|
||||
2016/AbstractEqualityComparison.js spackled
|
||||
2016/AbstractRelationalComparison.js spackled
|
||||
2016/AdvanceStringIndex.js spackled
|
||||
2016/ArrayCreate.js spackled
|
||||
2016/ArraySetLength.js spackled
|
||||
2016/ArraySpeciesCreate.js spackled
|
||||
2016/Call.js spackled
|
||||
2016/CanonicalNumericIndexString.js spackled
|
||||
2016/CompletePropertyDescriptor.js spackled
|
||||
2016/CreateDataProperty.js spackled
|
||||
2016/CreateDataPropertyOrThrow.js spackled
|
||||
2016/CreateHTML.js spackled
|
||||
2016/CreateIterResultObject.js spackled
|
||||
2016/CreateListFromArrayLike.js spackled
|
||||
2016/CreateMethodProperty.js spackled
|
||||
2016/DateFromTime.js spackled
|
||||
2016/Day.js spackled
|
||||
2016/DayFromYear.js spackled
|
||||
2016/DayWithinYear.js spackled
|
||||
2016/DaysInYear.js spackled
|
||||
2016/DefinePropertyOrThrow.js spackled
|
||||
2016/DeletePropertyOrThrow.js spackled
|
||||
2016/EnumerableOwnNames.js spackled
|
||||
2016/FromPropertyDescriptor.js spackled
|
||||
2016/Get.js spackled
|
||||
2016/GetIterator.js spackled
|
||||
2016/GetMethod.js spackled
|
||||
2016/GetOwnPropertyKeys.js spackled
|
||||
2016/GetPrototypeFromConstructor.js spackled
|
||||
2016/GetSubstitution.js spackled
|
||||
2016/GetV.js spackled
|
||||
2016/HasOwnProperty.js spackled
|
||||
2016/HasProperty.js spackled
|
||||
2016/HourFromTime.js spackled
|
||||
2016/InLeapYear.js spackled
|
||||
2016/InstanceofOperator.js spackled
|
||||
2016/Invoke.js spackled
|
||||
2016/IsAccessorDescriptor.js spackled
|
||||
2016/IsArray.js spackled
|
||||
2016/IsCallable.js spackled
|
||||
2016/IsConcatSpreadable.js spackled
|
||||
2016/IsConstructor.js spackled
|
||||
2016/IsDataDescriptor.js spackled
|
||||
2016/IsExtensible.js spackled
|
||||
2016/IsGenericDescriptor.js spackled
|
||||
2016/IsInteger.js spackled
|
||||
2016/IsPromise.js spackled
|
||||
2016/IsPropertyDescriptor.js spackled
|
||||
2016/IsPropertyKey.js spackled
|
||||
2016/IsRegExp.js spackled
|
||||
2016/IteratorClose.js spackled
|
||||
2016/IteratorComplete.js spackled
|
||||
2016/IteratorNext.js spackled
|
||||
2016/IteratorStep.js spackled
|
||||
2016/IteratorValue.js spackled
|
||||
2016/MakeDate.js spackled
|
||||
2016/MakeDay.js spackled
|
||||
2016/MakeTime.js spackled
|
||||
2016/MinFromTime.js spackled
|
||||
2016/MonthFromTime.js spackled
|
||||
2016/ObjectCreate.js spackled
|
||||
2016/OrdinaryDefineOwnProperty.js spackled
|
||||
2016/OrdinaryGetOwnProperty.js spackled
|
||||
2016/OrdinaryHasInstance.js spackled
|
||||
2016/OrdinaryHasProperty.js spackled
|
||||
2016/RegExpExec.js spackled
|
||||
2016/RequireObjectCoercible.js spackled
|
||||
2016/SameValue.js spackled
|
||||
2016/SameValueZero.js spackled
|
||||
2016/SecFromTime.js spackled
|
||||
2016/Set.js spackled
|
||||
2016/SetFunctionName.js spackled
|
||||
2016/SetIntegrityLevel.js spackled
|
||||
2016/SpeciesConstructor.js spackled
|
||||
2016/StrictEqualityComparison.js spackled
|
||||
2016/SymbolDescriptiveString.js spackled
|
||||
2016/TestIntegrityLevel.js spackled
|
||||
2016/TimeClip.js spackled
|
||||
2016/TimeFromYear.js spackled
|
||||
2016/TimeWithinDay.js spackled
|
||||
2016/ToBoolean.js spackled
|
||||
2016/ToDateString.js spackled
|
||||
2016/ToInt16.js spackled
|
||||
2016/ToInt32.js spackled
|
||||
2016/ToInt8.js spackled
|
||||
2016/ToInteger.js spackled
|
||||
2016/ToLength.js spackled
|
||||
2016/ToNumber.js spackled
|
||||
2016/ToObject.js spackled
|
||||
2016/ToPrimitive.js spackled
|
||||
2016/ToPropertyDescriptor.js spackled
|
||||
2016/ToPropertyKey.js spackled
|
||||
2016/ToString.js spackled
|
||||
2016/ToUint16.js spackled
|
||||
2016/ToUint32.js spackled
|
||||
2016/ToUint8.js spackled
|
||||
2016/ToUint8Clamp.js spackled
|
||||
2016/Type.js spackled
|
||||
2016/ValidateAndApplyPropertyDescriptor.js spackled
|
||||
2016/WeekDay.js spackled
|
||||
2016/YearFromTime.js spackled
|
||||
2016/modulo.js spackled
|
||||
2016/msFromTime.js spackled
|
||||
2016/thisBooleanValue.js spackled
|
||||
2016/thisNumberValue.js spackled
|
||||
2016/thisStringValue.js spackled
|
||||
2016/thisTimeValue.js spackled
|
||||
2017/AbstractEqualityComparison.js spackled
|
||||
2017/AbstractRelationalComparison.js spackled
|
||||
2017/AdvanceStringIndex.js spackled
|
||||
2017/ArrayCreate.js spackled
|
||||
2017/ArraySetLength.js spackled
|
||||
2017/ArraySpeciesCreate.js spackled
|
||||
2017/Call.js spackled
|
||||
2017/CanonicalNumericIndexString.js spackled
|
||||
2017/CompletePropertyDescriptor.js spackled
|
||||
2017/CreateDataProperty.js spackled
|
||||
2017/CreateDataPropertyOrThrow.js spackled
|
||||
2017/CreateHTML.js spackled
|
||||
2017/CreateIterResultObject.js spackled
|
||||
2017/CreateListFromArrayLike.js spackled
|
||||
2017/CreateMethodProperty.js spackled
|
||||
2017/DateFromTime.js spackled
|
||||
2017/Day.js spackled
|
||||
2017/DayFromYear.js spackled
|
||||
2017/DayWithinYear.js spackled
|
||||
2017/DaysInYear.js spackled
|
||||
2017/DefinePropertyOrThrow.js spackled
|
||||
2017/DeletePropertyOrThrow.js spackled
|
||||
2017/FromPropertyDescriptor.js spackled
|
||||
2017/Get.js spackled
|
||||
2017/GetIterator.js spackled
|
||||
2017/GetMethod.js spackled
|
||||
2017/GetOwnPropertyKeys.js spackled
|
||||
2017/GetPrototypeFromConstructor.js spackled
|
||||
2017/GetSubstitution.js spackled
|
||||
2017/GetV.js spackled
|
||||
2017/HasOwnProperty.js spackled
|
||||
2017/HasProperty.js spackled
|
||||
2017/HourFromTime.js spackled
|
||||
2017/InLeapYear.js spackled
|
||||
2017/InstanceofOperator.js spackled
|
||||
2017/Invoke.js spackled
|
||||
2017/IsAccessorDescriptor.js spackled
|
||||
2017/IsArray.js spackled
|
||||
2017/IsCallable.js spackled
|
||||
2017/IsConcatSpreadable.js spackled
|
||||
2017/IsConstructor.js spackled
|
||||
2017/IsDataDescriptor.js spackled
|
||||
2017/IsExtensible.js spackled
|
||||
2017/IsGenericDescriptor.js spackled
|
||||
2017/IsInteger.js spackled
|
||||
2017/IsPromise.js spackled
|
||||
2017/IsPropertyDescriptor.js spackled
|
||||
2017/IsPropertyKey.js spackled
|
||||
2017/IsRegExp.js spackled
|
||||
2017/IteratorClose.js spackled
|
||||
2017/IteratorComplete.js spackled
|
||||
2017/IteratorNext.js spackled
|
||||
2017/IteratorStep.js spackled
|
||||
2017/IteratorValue.js spackled
|
||||
2017/MakeDate.js spackled
|
||||
2017/MakeDay.js spackled
|
||||
2017/MakeTime.js spackled
|
||||
2017/MinFromTime.js spackled
|
||||
2017/MonthFromTime.js spackled
|
||||
2017/ObjectCreate.js spackled
|
||||
2017/OrdinaryDefineOwnProperty.js spackled
|
||||
2017/OrdinaryGetOwnProperty.js spackled
|
||||
2017/OrdinaryGetPrototypeOf.js spackled
|
||||
2017/OrdinaryHasInstance.js spackled
|
||||
2017/OrdinaryHasProperty.js spackled
|
||||
2017/OrdinarySetPrototypeOf.js spackled
|
||||
2017/RegExpExec.js spackled
|
||||
2017/RequireObjectCoercible.js spackled
|
||||
2017/SameValue.js spackled
|
||||
2017/SameValueNonNumber.js spackled
|
||||
2017/SameValueZero.js spackled
|
||||
2017/SecFromTime.js spackled
|
||||
2017/Set.js spackled
|
||||
2017/SetFunctionName.js spackled
|
||||
2017/SetIntegrityLevel.js spackled
|
||||
2017/SpeciesConstructor.js spackled
|
||||
2017/StrictEqualityComparison.js spackled
|
||||
2017/SymbolDescriptiveString.js spackled
|
||||
2017/TestIntegrityLevel.js spackled
|
||||
2017/TimeClip.js spackled
|
||||
2017/TimeFromYear.js spackled
|
||||
2017/TimeWithinDay.js spackled
|
||||
2017/ToBoolean.js spackled
|
||||
2017/ToDateString.js spackled
|
||||
2017/ToInt16.js spackled
|
||||
2017/ToInt32.js spackled
|
||||
2017/ToInt8.js spackled
|
||||
2017/ToInteger.js spackled
|
||||
2017/ToLength.js spackled
|
||||
2017/ToNumber.js spackled
|
||||
2017/ToObject.js spackled
|
||||
2017/ToPrimitive.js spackled
|
||||
2017/ToPropertyDescriptor.js spackled
|
||||
2017/ToPropertyKey.js spackled
|
||||
2017/ToString.js spackled
|
||||
2017/ToUint16.js spackled
|
||||
2017/ToUint32.js spackled
|
||||
2017/ToUint8.js spackled
|
||||
2017/ToUint8Clamp.js spackled
|
||||
2017/Type.js spackled
|
||||
2017/ValidateAndApplyPropertyDescriptor.js spackled
|
||||
2017/WeekDay.js spackled
|
||||
2017/YearFromTime.js spackled
|
||||
2017/modulo.js spackled
|
||||
2017/msFromTime.js spackled
|
||||
2017/thisBooleanValue.js spackled
|
||||
2017/thisNumberValue.js spackled
|
||||
2017/thisStringValue.js spackled
|
||||
2017/thisTimeValue.js spackled
|
||||
2018/AbstractEqualityComparison.js spackled
|
||||
2018/AbstractRelationalComparison.js spackled
|
||||
2018/AdvanceStringIndex.js spackled
|
||||
2018/ArrayCreate.js spackled
|
||||
2018/ArraySetLength.js spackled
|
||||
2018/ArraySpeciesCreate.js spackled
|
||||
2018/Call.js spackled
|
||||
2018/CanonicalNumericIndexString.js spackled
|
||||
2018/CompletePropertyDescriptor.js spackled
|
||||
2018/CreateDataProperty.js spackled
|
||||
2018/CreateDataPropertyOrThrow.js spackled
|
||||
2018/CreateHTML.js spackled
|
||||
2018/CreateIterResultObject.js spackled
|
||||
2018/CreateListFromArrayLike.js spackled
|
||||
2018/CreateMethodProperty.js spackled
|
||||
2018/DateFromTime.js spackled
|
||||
2018/Day.js spackled
|
||||
2018/DayFromYear.js spackled
|
||||
2018/DayWithinYear.js spackled
|
||||
2018/DaysInYear.js spackled
|
||||
2018/DefinePropertyOrThrow.js spackled
|
||||
2018/DeletePropertyOrThrow.js spackled
|
||||
2018/FromPropertyDescriptor.js spackled
|
||||
2018/Get.js spackled
|
||||
2018/GetIterator.js spackled
|
||||
2018/GetMethod.js spackled
|
||||
2018/GetOwnPropertyKeys.js spackled
|
||||
2018/GetPrototypeFromConstructor.js spackled
|
||||
2018/GetV.js spackled
|
||||
2018/HasOwnProperty.js spackled
|
||||
2018/HasProperty.js spackled
|
||||
2018/HourFromTime.js spackled
|
||||
2018/InLeapYear.js spackled
|
||||
2018/InstanceofOperator.js spackled
|
||||
2018/Invoke.js spackled
|
||||
2018/IsAccessorDescriptor.js spackled
|
||||
2018/IsArray.js spackled
|
||||
2018/IsCallable.js spackled
|
||||
2018/IsConcatSpreadable.js spackled
|
||||
2018/IsConstructor.js spackled
|
||||
2018/IsDataDescriptor.js spackled
|
||||
2018/IsExtensible.js spackled
|
||||
2018/IsGenericDescriptor.js spackled
|
||||
2018/IsInteger.js spackled
|
||||
2018/IsPromise.js spackled
|
||||
2018/IsPropertyKey.js spackled
|
||||
2018/IsRegExp.js spackled
|
||||
2018/IterableToList.js spackled
|
||||
2018/IteratorClose.js spackled
|
||||
2018/IteratorComplete.js spackled
|
||||
2018/IteratorNext.js spackled
|
||||
2018/IteratorStep.js spackled
|
||||
2018/IteratorValue.js spackled
|
||||
2018/MakeDate.js spackled
|
||||
2018/MakeDay.js spackled
|
||||
2018/MakeTime.js spackled
|
||||
2018/MinFromTime.js spackled
|
||||
2018/MonthFromTime.js spackled
|
||||
2018/ObjectCreate.js spackled
|
||||
2018/OrdinaryDefineOwnProperty.js spackled
|
||||
2018/OrdinaryGetOwnProperty.js spackled
|
||||
2018/OrdinaryGetPrototypeOf.js spackled
|
||||
2018/OrdinaryHasInstance.js spackled
|
||||
2018/OrdinaryHasProperty.js spackled
|
||||
2018/OrdinarySetPrototypeOf.js spackled
|
||||
2018/RegExpExec.js spackled
|
||||
2018/RequireObjectCoercible.js spackled
|
||||
2018/SameValue.js spackled
|
||||
2018/SameValueNonNumber.js spackled
|
||||
2018/SameValueZero.js spackled
|
||||
2018/SecFromTime.js spackled
|
||||
2018/Set.js spackled
|
||||
2018/SetFunctionName.js spackled
|
||||
2018/SetIntegrityLevel.js spackled
|
||||
2018/SpeciesConstructor.js spackled
|
||||
2018/StrictEqualityComparison.js spackled
|
||||
2018/SymbolDescriptiveString.js spackled
|
||||
2018/TestIntegrityLevel.js spackled
|
||||
2018/TimeClip.js spackled
|
||||
2018/TimeFromYear.js spackled
|
||||
2018/TimeWithinDay.js spackled
|
||||
2018/ToBoolean.js spackled
|
||||
2018/ToDateString.js spackled
|
||||
2018/ToIndex.js spackled
|
||||
2018/ToInt16.js spackled
|
||||
2018/ToInt32.js spackled
|
||||
2018/ToInt8.js spackled
|
||||
2018/ToInteger.js spackled
|
||||
2018/ToLength.js spackled
|
||||
2018/ToNumber.js spackled
|
||||
2018/ToObject.js spackled
|
||||
2018/ToPrimitive.js spackled
|
||||
2018/ToPropertyDescriptor.js spackled
|
||||
2018/ToPropertyKey.js spackled
|
||||
2018/ToString.js spackled
|
||||
2018/ToUint16.js spackled
|
||||
2018/ToUint32.js spackled
|
||||
2018/ToUint8.js spackled
|
||||
2018/ToUint8Clamp.js spackled
|
||||
2018/Type.js spackled
|
||||
2018/ValidateAndApplyPropertyDescriptor.js spackled
|
||||
2018/WeekDay.js spackled
|
||||
2018/YearFromTime.js spackled
|
||||
2018/modulo.js spackled
|
||||
2018/msFromTime.js spackled
|
||||
2018/thisBooleanValue.js spackled
|
||||
2018/thisNumberValue.js spackled
|
||||
2018/thisStringValue.js spackled
|
||||
2018/thisTimeValue.js spackled
|
||||
2019/AbstractEqualityComparison.js spackled
|
||||
2019/AbstractRelationalComparison.js spackled
|
||||
2019/AdvanceStringIndex.js spackled
|
||||
2019/ArrayCreate.js spackled
|
||||
2019/ArraySetLength.js spackled
|
||||
2019/ArraySpeciesCreate.js spackled
|
||||
2019/Call.js spackled
|
||||
2019/CanonicalNumericIndexString.js spackled
|
||||
2019/CompletePropertyDescriptor.js spackled
|
||||
2019/CopyDataProperties.js spackled
|
||||
2019/CreateDataProperty.js spackled
|
||||
2019/CreateDataPropertyOrThrow.js spackled
|
||||
2019/CreateHTML.js spackled
|
||||
2019/CreateIterResultObject.js spackled
|
||||
2019/CreateListFromArrayLike.js spackled
|
||||
2019/CreateMethodProperty.js spackled
|
||||
2019/DateFromTime.js spackled
|
||||
2019/DateString.js spackled
|
||||
2019/Day.js spackled
|
||||
2019/DayFromYear.js spackled
|
||||
2019/DayWithinYear.js spackled
|
||||
2019/DaysInYear.js spackled
|
||||
2019/DefinePropertyOrThrow.js spackled
|
||||
2019/DeletePropertyOrThrow.js spackled
|
||||
2019/EnumerableOwnPropertyNames.js spackled
|
||||
2019/FromPropertyDescriptor.js spackled
|
||||
2019/Get.js spackled
|
||||
2019/GetIterator.js spackled
|
||||
2019/GetMethod.js spackled
|
||||
2019/GetOwnPropertyKeys.js spackled
|
||||
2019/GetPrototypeFromConstructor.js spackled
|
||||
2019/GetSubstitution.js spackled
|
||||
2019/GetV.js spackled
|
||||
2019/HasOwnProperty.js spackled
|
||||
2019/HasProperty.js spackled
|
||||
2019/HourFromTime.js spackled
|
||||
2019/InLeapYear.js spackled
|
||||
2019/InstanceofOperator.js spackled
|
||||
2019/Invoke.js spackled
|
||||
2019/IsAccessorDescriptor.js spackled
|
||||
2019/IsArray.js spackled
|
||||
2019/IsCallable.js spackled
|
||||
2019/IsConcatSpreadable.js spackled
|
||||
2019/IsConstructor.js spackled
|
||||
2019/IsDataDescriptor.js spackled
|
||||
2019/IsExtensible.js spackled
|
||||
2019/IsGenericDescriptor.js spackled
|
||||
2019/IsInteger.js spackled
|
||||
2019/IsPromise.js spackled
|
||||
2019/IsPropertyKey.js spackled
|
||||
2019/IsRegExp.js spackled
|
||||
2019/IsStringPrefix.js spackled
|
||||
2019/IterableToList.js spackled
|
||||
2019/IteratorClose.js spackled
|
||||
2019/IteratorComplete.js spackled
|
||||
2019/IteratorNext.js spackled
|
||||
2019/IteratorStep.js spackled
|
||||
2019/IteratorValue.js spackled
|
||||
2019/MakeDate.js spackled
|
||||
2019/MakeDay.js spackled
|
||||
2019/MakeTime.js spackled
|
||||
2019/MinFromTime.js spackled
|
||||
2019/MonthFromTime.js spackled
|
||||
2019/NumberToString.js spackled
|
||||
2019/ObjectCreate.js spackled
|
||||
2019/OrdinaryDefineOwnProperty.js spackled
|
||||
2019/OrdinaryGetOwnProperty.js spackled
|
||||
2019/OrdinaryGetPrototypeOf.js spackled
|
||||
2019/OrdinaryHasInstance.js spackled
|
||||
2019/OrdinaryHasProperty.js spackled
|
||||
2019/OrdinarySetPrototypeOf.js spackled
|
||||
2019/PromiseResolve.js spackled
|
||||
2019/RegExpExec.js spackled
|
||||
2019/RequireObjectCoercible.js spackled
|
||||
2019/SameValue.js spackled
|
||||
2019/SameValueNonNumber.js spackled
|
||||
2019/SameValueZero.js spackled
|
||||
2019/SecFromTime.js spackled
|
||||
2019/Set.js spackled
|
||||
2019/SetFunctionName.js spackled
|
||||
2019/SetIntegrityLevel.js spackled
|
||||
2019/SpeciesConstructor.js spackled
|
||||
2019/StrictEqualityComparison.js spackled
|
||||
2019/SymbolDescriptiveString.js spackled
|
||||
2019/TestIntegrityLevel.js spackled
|
||||
2019/TimeClip.js spackled
|
||||
2019/TimeFromYear.js spackled
|
||||
2019/TimeString.js spackled
|
||||
2019/TimeWithinDay.js spackled
|
||||
2019/ToBoolean.js spackled
|
||||
2019/ToDateString.js spackled
|
||||
2019/ToIndex.js spackled
|
||||
2019/ToInt16.js spackled
|
||||
2019/ToInt32.js spackled
|
||||
2019/ToInt8.js spackled
|
||||
2019/ToInteger.js spackled
|
||||
2019/ToLength.js spackled
|
||||
2019/ToNumber.js spackled
|
||||
2019/ToObject.js spackled
|
||||
2019/ToPrimitive.js spackled
|
||||
2019/ToPropertyDescriptor.js spackled
|
||||
2019/ToPropertyKey.js spackled
|
||||
2019/ToString.js spackled
|
||||
2019/ToUint16.js spackled
|
||||
2019/ToUint32.js spackled
|
||||
2019/ToUint8.js spackled
|
||||
2019/ToUint8Clamp.js spackled
|
||||
2019/Type.js spackled
|
||||
2019/ValidateAndApplyPropertyDescriptor.js spackled
|
||||
2019/WeekDay.js spackled
|
||||
2019/YearFromTime.js spackled
|
||||
2019/modulo.js spackled
|
||||
2019/msFromTime.js spackled
|
||||
2019/thisBooleanValue.js spackled
|
||||
2019/thisNumberValue.js spackled
|
||||
2019/thisStringValue.js spackled
|
||||
2019/thisSymbolValue.js spackled
|
12
node_modules/es-abstract/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/es-abstract/.github/FUNDING.yml
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/es-abstract
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with a single custom sponsorship URL
|
15
node_modules/es-abstract/.github/workflows/rebase.yml
generated
vendored
Normal file
15
node_modules/es-abstract/.github/workflows/rebase.yml
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
name: Automatic Rebase
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
_:
|
||||
name: "Automatic Rebase"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: ljharb/rebase@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
14
node_modules/es-abstract/.nycrc
generated
vendored
Normal file
14
node_modules/es-abstract/.nycrc
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"lines": 86,
|
||||
"statements": 85.93,
|
||||
"functions": 82.43,
|
||||
"branches": 76.06,
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"operations",
|
||||
"test"
|
||||
]
|
||||
}
|
32
node_modules/es-abstract/.travis.yml
generated
vendored
Normal file
32
node_modules/es-abstract/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
version: ~> 1.0
|
||||
language: node_js
|
||||
os:
|
||||
- linux
|
||||
cache:
|
||||
directories:
|
||||
- "$HOME/.npm"
|
||||
- "$(nvm cache dir)"
|
||||
- "$(nvm_version_path $(nvm_version_remote 0.4))"
|
||||
- "$(nvm_version_path $(nvm_version_remote 0.6))"
|
||||
- "$(nvm_version_path $(nvm_version_remote 0.10))"
|
||||
import:
|
||||
- ljharb/travis-ci:node/all.yml
|
||||
- ljharb/travis-ci:node/pretest.yml
|
||||
- ljharb/travis-ci:node/posttest.yml
|
||||
script:
|
||||
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage && bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi'
|
||||
matrix:
|
||||
include:
|
||||
- node_js: "8"
|
||||
env: COVERAGE=true
|
||||
- node_js: "4"
|
||||
env: COVERAGE=true
|
||||
- node_js: "0.12"
|
||||
env: COVERAGE=true
|
||||
- node_js: "0.8"
|
||||
env: COVERAGE=true
|
||||
exclude:
|
||||
- node_js: "0.12"
|
||||
env: TEST=true
|
||||
- node_js: "0.8"
|
||||
env: TEST=true
|
37
node_modules/es-abstract/2015/AbstractEqualityComparison.js
generated
vendored
Normal file
37
node_modules/es-abstract/2015/AbstractEqualityComparison.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
var ToNumber = require('./ToNumber');
|
||||
var ToPrimitive = require('./ToPrimitive');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison
|
||||
|
||||
module.exports = function AbstractEqualityComparison(x, y) {
|
||||
var xType = Type(x);
|
||||
var yType = Type(y);
|
||||
if (xType === yType) {
|
||||
return x === y; // ES6+ specified this shortcut anyways.
|
||||
}
|
||||
if (x == null && y == null) {
|
||||
return true;
|
||||
}
|
||||
if (xType === 'Number' && yType === 'String') {
|
||||
return AbstractEqualityComparison(x, ToNumber(y));
|
||||
}
|
||||
if (xType === 'String' && yType === 'Number') {
|
||||
return AbstractEqualityComparison(ToNumber(x), y);
|
||||
}
|
||||
if (xType === 'Boolean') {
|
||||
return AbstractEqualityComparison(ToNumber(x), y);
|
||||
}
|
||||
if (yType === 'Boolean') {
|
||||
return AbstractEqualityComparison(x, ToNumber(y));
|
||||
}
|
||||
if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') {
|
||||
return AbstractEqualityComparison(x, ToPrimitive(y));
|
||||
}
|
||||
if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) {
|
||||
return AbstractEqualityComparison(ToPrimitive(x), y);
|
||||
}
|
||||
return false;
|
||||
};
|
66
node_modules/es-abstract/2015/AbstractRelationalComparison.js
generated
vendored
Normal file
66
node_modules/es-abstract/2015/AbstractRelationalComparison.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $Number = GetIntrinsic('%Number%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $isNaN = require('../helpers/isNaN');
|
||||
var $isFinite = require('../helpers/isFinite');
|
||||
var isPrefixOf = require('../helpers/isPrefixOf');
|
||||
|
||||
var ToNumber = require('./ToNumber');
|
||||
var ToPrimitive = require('./ToPrimitive');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5
|
||||
|
||||
// eslint-disable-next-line max-statements
|
||||
module.exports = function AbstractRelationalComparison(x, y, LeftFirst) {
|
||||
if (Type(LeftFirst) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean');
|
||||
}
|
||||
var px;
|
||||
var py;
|
||||
if (LeftFirst) {
|
||||
px = ToPrimitive(x, $Number);
|
||||
py = ToPrimitive(y, $Number);
|
||||
} else {
|
||||
py = ToPrimitive(y, $Number);
|
||||
px = ToPrimitive(x, $Number);
|
||||
}
|
||||
var bothStrings = Type(px) === 'String' && Type(py) === 'String';
|
||||
if (!bothStrings) {
|
||||
var nx = ToNumber(px);
|
||||
var ny = ToNumber(py);
|
||||
if ($isNaN(nx) || $isNaN(ny)) {
|
||||
return undefined;
|
||||
}
|
||||
if ($isFinite(nx) && $isFinite(ny) && nx === ny) {
|
||||
return false;
|
||||
}
|
||||
if (nx === 0 && ny === 0) {
|
||||
return false;
|
||||
}
|
||||
if (nx === Infinity) {
|
||||
return false;
|
||||
}
|
||||
if (ny === Infinity) {
|
||||
return true;
|
||||
}
|
||||
if (ny === -Infinity) {
|
||||
return false;
|
||||
}
|
||||
if (nx === -Infinity) {
|
||||
return true;
|
||||
}
|
||||
return nx < ny; // by now, these are both nonzero, finite, and not equal
|
||||
}
|
||||
if (isPrefixOf(py, px)) {
|
||||
return false;
|
||||
}
|
||||
if (isPrefixOf(px, py)) {
|
||||
return true;
|
||||
}
|
||||
return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f
|
||||
};
|
45
node_modules/es-abstract/2015/AdvanceStringIndex.js
generated
vendored
Normal file
45
node_modules/es-abstract/2015/AdvanceStringIndex.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var IsInteger = require('./IsInteger');
|
||||
var Type = require('./Type');
|
||||
|
||||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $charCodeAt = require('../helpers/callBound')('String.prototype.charCodeAt');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex
|
||||
|
||||
module.exports = function AdvanceStringIndex(S, index, unicode) {
|
||||
if (Type(S) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `S` must be a String');
|
||||
}
|
||||
if (!IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {
|
||||
throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');
|
||||
}
|
||||
if (Type(unicode) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: `unicode` must be a Boolean');
|
||||
}
|
||||
if (!unicode) {
|
||||
return index + 1;
|
||||
}
|
||||
var length = S.length;
|
||||
if ((index + 1) >= length) {
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
var first = $charCodeAt(S, index);
|
||||
if (first < 0xD800 || first > 0xDBFF) {
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
var second = $charCodeAt(S, index + 1);
|
||||
if (second < 0xDC00 || second > 0xDFFF) {
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
return index + 2;
|
||||
};
|
53
node_modules/es-abstract/2015/ArrayCreate.js
generated
vendored
Normal file
53
node_modules/es-abstract/2015/ArrayCreate.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $ArrayPrototype = GetIntrinsic('%Array.prototype%');
|
||||
var $RangeError = GetIntrinsic('%RangeError%');
|
||||
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsInteger = require('./IsInteger');
|
||||
|
||||
var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1;
|
||||
|
||||
var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || (
|
||||
// eslint-disable-next-line no-proto, no-negated-condition
|
||||
[].__proto__ !== $ArrayPrototype
|
||||
? null
|
||||
: function (O, proto) {
|
||||
O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign
|
||||
return O;
|
||||
}
|
||||
);
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate
|
||||
|
||||
module.exports = function ArrayCreate(length) {
|
||||
if (!IsInteger(length) || length < 0) {
|
||||
throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0');
|
||||
}
|
||||
if (length > MAX_ARRAY_LENGTH) {
|
||||
throw new $RangeError('length is greater than (2**32 - 1)');
|
||||
}
|
||||
var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype;
|
||||
var A = []; // steps 5 - 7, and 9
|
||||
if (proto !== $ArrayPrototype) { // step 8
|
||||
if (!$setProto) {
|
||||
throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]');
|
||||
}
|
||||
$setProto(A, proto);
|
||||
}
|
||||
if (length !== 0) { // bypasses the need for step 2
|
||||
A.length = length;
|
||||
}
|
||||
/* step 10, the above as a shortcut for the below
|
||||
OrdinaryDefineOwnProperty(A, 'length', {
|
||||
'[[Configurable]]': false,
|
||||
'[[Enumerable]]': false,
|
||||
'[[Value]]': length,
|
||||
'[[Writable]]': true
|
||||
});
|
||||
*/
|
||||
return A;
|
||||
};
|
85
node_modules/es-abstract/2015/ArraySetLength.js
generated
vendored
Normal file
85
node_modules/es-abstract/2015/ArraySetLength.js
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $RangeError = GetIntrinsic('%RangeError%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var assign = require('object.assign');
|
||||
|
||||
var isPropertyDescriptor = require('../helpers/isPropertyDescriptor');
|
||||
|
||||
var IsArray = require('./IsArray');
|
||||
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
|
||||
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||
var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty');
|
||||
var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty');
|
||||
var ToNumber = require('./ToNumber');
|
||||
var ToString = require('./ToString');
|
||||
var ToUint32 = require('./ToUint32');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-arraysetlength
|
||||
|
||||
// eslint-disable-next-line max-statements, max-lines-per-function
|
||||
module.exports = function ArraySetLength(A, Desc) {
|
||||
if (!IsArray(A)) {
|
||||
throw new $TypeError('Assertion failed: A must be an Array');
|
||||
}
|
||||
if (!isPropertyDescriptor({
|
||||
Type: Type,
|
||||
IsDataDescriptor: IsDataDescriptor,
|
||||
IsAccessorDescriptor: IsAccessorDescriptor
|
||||
}, Desc)) {
|
||||
throw new $TypeError('Assertion failed: Desc must be a Property Descriptor');
|
||||
}
|
||||
if (!('[[Value]]' in Desc)) {
|
||||
return OrdinaryDefineOwnProperty(A, 'length', Desc);
|
||||
}
|
||||
var newLenDesc = assign({}, Desc);
|
||||
var newLen = ToUint32(Desc['[[Value]]']);
|
||||
var numberLen = ToNumber(Desc['[[Value]]']);
|
||||
if (newLen !== numberLen) {
|
||||
throw new $RangeError('Invalid array length');
|
||||
}
|
||||
newLenDesc['[[Value]]'] = newLen;
|
||||
var oldLenDesc = OrdinaryGetOwnProperty(A, 'length');
|
||||
if (!IsDataDescriptor(oldLenDesc)) {
|
||||
throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`');
|
||||
}
|
||||
var oldLen = oldLenDesc['[[Value]]'];
|
||||
if (newLen >= oldLen) {
|
||||
return OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
|
||||
}
|
||||
if (!oldLenDesc['[[Writable]]']) {
|
||||
return false;
|
||||
}
|
||||
var newWritable;
|
||||
if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) {
|
||||
newWritable = true;
|
||||
} else {
|
||||
newWritable = false;
|
||||
newLenDesc['[[Writable]]'] = true;
|
||||
}
|
||||
var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
|
||||
if (!succeeded) {
|
||||
return false;
|
||||
}
|
||||
while (newLen < oldLen) {
|
||||
oldLen -= 1;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
var deleteSucceeded = delete A[ToString(oldLen)];
|
||||
if (!deleteSucceeded) {
|
||||
newLenDesc['[[Value]]'] = oldLen + 1;
|
||||
if (!newWritable) {
|
||||
newLenDesc['[[Writable]]'] = false;
|
||||
OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!newWritable) {
|
||||
return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false });
|
||||
}
|
||||
return true;
|
||||
};
|
46
node_modules/es-abstract/2015/ArraySpeciesCreate.js
generated
vendored
Normal file
46
node_modules/es-abstract/2015/ArraySpeciesCreate.js
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $Array = GetIntrinsic('%Array%');
|
||||
var $species = GetIntrinsic('%Symbol.species%', true);
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Get = require('./Get');
|
||||
var IsArray = require('./IsArray');
|
||||
var IsConstructor = require('./IsConstructor');
|
||||
var IsInteger = require('./IsInteger');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate
|
||||
|
||||
module.exports = function ArraySpeciesCreate(originalArray, length) {
|
||||
if (!IsInteger(length) || length < 0) {
|
||||
throw new $TypeError('Assertion failed: length must be an integer >= 0');
|
||||
}
|
||||
var len = length === 0 ? 0 : length;
|
||||
var C;
|
||||
var isArray = IsArray(originalArray);
|
||||
if (isArray) {
|
||||
C = Get(originalArray, 'constructor');
|
||||
// TODO: figure out how to make a cross-realm normal Array, a same-realm Array
|
||||
// if (IsConstructor(C)) {
|
||||
// if C is another realm's Array, C = undefined
|
||||
// Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
|
||||
// }
|
||||
if ($species && Type(C) === 'Object') {
|
||||
C = Get(C, $species);
|
||||
if (C === null) {
|
||||
C = void 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof C === 'undefined') {
|
||||
return $Array(len);
|
||||
}
|
||||
if (!IsConstructor(C)) {
|
||||
throw new $TypeError('C must be a constructor');
|
||||
}
|
||||
return new C(len); // Construct(C, len);
|
||||
};
|
||||
|
19
node_modules/es-abstract/2015/Call.js
generated
vendored
Normal file
19
node_modules/es-abstract/2015/Call.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var inspect = require('object-inspect');
|
||||
|
||||
var IsCallable = require('./IsCallable');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-call
|
||||
|
||||
module.exports = function Call(F, V) {
|
||||
var args = arguments.length > 2 ? arguments[2] : [];
|
||||
if (!IsCallable(F)) {
|
||||
throw new $TypeError(inspect(F) + ' is not a function');
|
||||
}
|
||||
return F.apply(V, args);
|
||||
};
|
22
node_modules/es-abstract/2015/CanonicalNumericIndexString.js
generated
vendored
Normal file
22
node_modules/es-abstract/2015/CanonicalNumericIndexString.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var SameValue = require('./SameValue');
|
||||
var ToNumber = require('./ToNumber');
|
||||
var ToString = require('./ToString');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring
|
||||
|
||||
module.exports = function CanonicalNumericIndexString(argument) {
|
||||
if (Type(argument) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `argument` must be a String');
|
||||
}
|
||||
if (argument === '-0') { return -0; }
|
||||
var n = ToNumber(argument);
|
||||
if (SameValue(ToString(n), argument)) { return n; }
|
||||
return void 0;
|
||||
};
|
39
node_modules/es-abstract/2015/CompletePropertyDescriptor.js
generated
vendored
Normal file
39
node_modules/es-abstract/2015/CompletePropertyDescriptor.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
var has = require('has');
|
||||
|
||||
var assertRecord = require('../helpers/assertRecord');
|
||||
|
||||
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||
var IsGenericDescriptor = require('./IsGenericDescriptor');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor
|
||||
|
||||
module.exports = function CompletePropertyDescriptor(Desc) {
|
||||
/* eslint no-param-reassign: 0 */
|
||||
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
|
||||
|
||||
if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) {
|
||||
if (!has(Desc, '[[Value]]')) {
|
||||
Desc['[[Value]]'] = void 0;
|
||||
}
|
||||
if (!has(Desc, '[[Writable]]')) {
|
||||
Desc['[[Writable]]'] = false;
|
||||
}
|
||||
} else {
|
||||
if (!has(Desc, '[[Get]]')) {
|
||||
Desc['[[Get]]'] = void 0;
|
||||
}
|
||||
if (!has(Desc, '[[Set]]')) {
|
||||
Desc['[[Set]]'] = void 0;
|
||||
}
|
||||
}
|
||||
if (!has(Desc, '[[Enumerable]]')) {
|
||||
Desc['[[Enumerable]]'] = false;
|
||||
}
|
||||
if (!has(Desc, '[[Configurable]]')) {
|
||||
Desc['[[Configurable]]'] = false;
|
||||
}
|
||||
return Desc;
|
||||
};
|
45
node_modules/es-abstract/2015/CreateDataProperty.js
generated
vendored
Normal file
45
node_modules/es-abstract/2015/CreateDataProperty.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var DefineOwnProperty = require('../helpers/DefineOwnProperty');
|
||||
|
||||
var FromPropertyDescriptor = require('./FromPropertyDescriptor');
|
||||
var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty');
|
||||
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||
var IsExtensible = require('./IsExtensible');
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var SameValue = require('./SameValue');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty
|
||||
|
||||
module.exports = function CreateDataProperty(O, P, V) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
||||
}
|
||||
var oldDesc = OrdinaryGetOwnProperty(O, P);
|
||||
var extensible = oldDesc || IsExtensible(O);
|
||||
var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable);
|
||||
if (immutable || !extensible) {
|
||||
return false;
|
||||
}
|
||||
return DefineOwnProperty(
|
||||
IsDataDescriptor,
|
||||
SameValue,
|
||||
FromPropertyDescriptor,
|
||||
O,
|
||||
P,
|
||||
{
|
||||
'[[Configurable]]': true,
|
||||
'[[Enumerable]]': true,
|
||||
'[[Value]]': V,
|
||||
'[[Writable]]': true
|
||||
}
|
||||
);
|
||||
};
|
25
node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js
generated
vendored
Normal file
25
node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var CreateDataProperty = require('./CreateDataProperty');
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var Type = require('./Type');
|
||||
|
||||
// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow
|
||||
|
||||
module.exports = function CreateDataPropertyOrThrow(O, P, V) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
||||
}
|
||||
var success = CreateDataProperty(O, P, V);
|
||||
if (!success) {
|
||||
throw new $TypeError('unable to create data property');
|
||||
}
|
||||
return success;
|
||||
};
|
30
node_modules/es-abstract/2015/CreateHTML.js
generated
vendored
Normal file
30
node_modules/es-abstract/2015/CreateHTML.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var callBound = require('../helpers/callBound');
|
||||
|
||||
var $replace = callBound('String.prototype.replace');
|
||||
|
||||
var RequireObjectCoercible = require('./RequireObjectCoercible');
|
||||
var ToString = require('./ToString');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml
|
||||
|
||||
module.exports = function CreateHTML(string, tag, attribute, value) {
|
||||
if (Type(tag) !== 'String' || Type(attribute) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings');
|
||||
}
|
||||
var str = RequireObjectCoercible(string);
|
||||
var S = ToString(str);
|
||||
var p1 = '<' + tag;
|
||||
if (attribute !== '') {
|
||||
var V = ToString(value);
|
||||
var escapedV = $replace(V, /\x22/g, '"');
|
||||
p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22';
|
||||
}
|
||||
return p1 + '>' + S + '</' + tag + '>';
|
||||
};
|
19
node_modules/es-abstract/2015/CreateIterResultObject.js
generated
vendored
Normal file
19
node_modules/es-abstract/2015/CreateIterResultObject.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject
|
||||
|
||||
module.exports = function CreateIterResultObject(value, done) {
|
||||
if (Type(done) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: Type(done) is not Boolean');
|
||||
}
|
||||
return {
|
||||
value: value,
|
||||
done: done
|
||||
};
|
||||
};
|
43
node_modules/es-abstract/2015/CreateListFromArrayLike.js
generated
vendored
Normal file
43
node_modules/es-abstract/2015/CreateListFromArrayLike.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var callBound = require('../helpers/callBound');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf');
|
||||
var $push = callBound('Array.prototype.push');
|
||||
|
||||
var Get = require('./Get');
|
||||
var IsArray = require('./IsArray');
|
||||
var ToLength = require('./ToLength');
|
||||
var ToString = require('./ToString');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike
|
||||
module.exports = function CreateListFromArrayLike(obj) {
|
||||
var elementTypes = arguments.length > 1
|
||||
? arguments[1]
|
||||
: ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object'];
|
||||
|
||||
if (Type(obj) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: `obj` must be an Object');
|
||||
}
|
||||
if (!IsArray(elementTypes)) {
|
||||
throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array');
|
||||
}
|
||||
var len = ToLength(Get(obj, 'length'));
|
||||
var list = [];
|
||||
var index = 0;
|
||||
while (index < len) {
|
||||
var indexName = ToString(index);
|
||||
var next = Get(obj, indexName);
|
||||
var nextType = Type(next);
|
||||
if ($indexOf(elementTypes, nextType) < 0) {
|
||||
throw new $TypeError('item type ' + nextType + ' is not a valid elementType');
|
||||
}
|
||||
$push(list, next);
|
||||
index += 1;
|
||||
}
|
||||
return list;
|
||||
};
|
40
node_modules/es-abstract/2015/CreateMethodProperty.js
generated
vendored
Normal file
40
node_modules/es-abstract/2015/CreateMethodProperty.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var DefineOwnProperty = require('../helpers/DefineOwnProperty');
|
||||
|
||||
var FromPropertyDescriptor = require('./FromPropertyDescriptor');
|
||||
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var SameValue = require('./SameValue');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty
|
||||
|
||||
module.exports = function CreateMethodProperty(O, P, V) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
||||
}
|
||||
|
||||
var newDesc = {
|
||||
'[[Configurable]]': true,
|
||||
'[[Enumerable]]': false,
|
||||
'[[Value]]': V,
|
||||
'[[Writable]]': true
|
||||
};
|
||||
return DefineOwnProperty(
|
||||
IsDataDescriptor,
|
||||
SameValue,
|
||||
FromPropertyDescriptor,
|
||||
O,
|
||||
P,
|
||||
newDesc
|
||||
);
|
||||
};
|
54
node_modules/es-abstract/2015/DateFromTime.js
generated
vendored
Normal file
54
node_modules/es-abstract/2015/DateFromTime.js
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $EvalError = GetIntrinsic('%EvalError%');
|
||||
|
||||
var DayWithinYear = require('./DayWithinYear');
|
||||
var InLeapYear = require('./InLeapYear');
|
||||
var MonthFromTime = require('./MonthFromTime');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5
|
||||
|
||||
module.exports = function DateFromTime(t) {
|
||||
var m = MonthFromTime(t);
|
||||
var d = DayWithinYear(t);
|
||||
if (m === 0) {
|
||||
return d + 1;
|
||||
}
|
||||
if (m === 1) {
|
||||
return d - 30;
|
||||
}
|
||||
var leap = InLeapYear(t);
|
||||
if (m === 2) {
|
||||
return d - 58 - leap;
|
||||
}
|
||||
if (m === 3) {
|
||||
return d - 89 - leap;
|
||||
}
|
||||
if (m === 4) {
|
||||
return d - 119 - leap;
|
||||
}
|
||||
if (m === 5) {
|
||||
return d - 150 - leap;
|
||||
}
|
||||
if (m === 6) {
|
||||
return d - 180 - leap;
|
||||
}
|
||||
if (m === 7) {
|
||||
return d - 211 - leap;
|
||||
}
|
||||
if (m === 8) {
|
||||
return d - 242 - leap;
|
||||
}
|
||||
if (m === 9) {
|
||||
return d - 272 - leap;
|
||||
}
|
||||
if (m === 10) {
|
||||
return d - 303 - leap;
|
||||
}
|
||||
if (m === 11) {
|
||||
return d - 333 - leap;
|
||||
}
|
||||
throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m);
|
||||
};
|
13
node_modules/es-abstract/2015/Day.js
generated
vendored
Normal file
13
node_modules/es-abstract/2015/Day.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $floor = GetIntrinsic('%Math.floor%');
|
||||
|
||||
var msPerDay = require('../helpers/timeConstants').msPerDay;
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2
|
||||
|
||||
module.exports = function Day(t) {
|
||||
return $floor(t / msPerDay);
|
||||
};
|
12
node_modules/es-abstract/2015/DayFromYear.js
generated
vendored
Normal file
12
node_modules/es-abstract/2015/DayFromYear.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $floor = GetIntrinsic('%Math.floor%');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3
|
||||
|
||||
module.exports = function DayFromYear(y) {
|
||||
return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400);
|
||||
};
|
||||
|
11
node_modules/es-abstract/2015/DayWithinYear.js
generated
vendored
Normal file
11
node_modules/es-abstract/2015/DayWithinYear.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
var Day = require('./Day');
|
||||
var DayFromYear = require('./DayFromYear');
|
||||
var YearFromTime = require('./YearFromTime');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4
|
||||
|
||||
module.exports = function DayWithinYear(t) {
|
||||
return Day(t) - DayFromYear(YearFromTime(t));
|
||||
};
|
18
node_modules/es-abstract/2015/DaysInYear.js
generated
vendored
Normal file
18
node_modules/es-abstract/2015/DaysInYear.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var mod = require('../helpers/mod');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3
|
||||
|
||||
module.exports = function DaysInYear(y) {
|
||||
if (mod(y, 4) !== 0) {
|
||||
return 365;
|
||||
}
|
||||
if (mod(y, 100) !== 0) {
|
||||
return 366;
|
||||
}
|
||||
if (mod(y, 400) !== 0) {
|
||||
return 365;
|
||||
}
|
||||
return 366;
|
||||
};
|
50
node_modules/es-abstract/2015/DefinePropertyOrThrow.js
generated
vendored
Normal file
50
node_modules/es-abstract/2015/DefinePropertyOrThrow.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var isPropertyDescriptor = require('../helpers/isPropertyDescriptor');
|
||||
var DefineOwnProperty = require('../helpers/DefineOwnProperty');
|
||||
|
||||
var FromPropertyDescriptor = require('./FromPropertyDescriptor');
|
||||
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
|
||||
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var SameValue = require('./SameValue');
|
||||
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow
|
||||
|
||||
module.exports = function DefinePropertyOrThrow(O, P, desc) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
||||
}
|
||||
|
||||
var Desc = isPropertyDescriptor({
|
||||
Type: Type,
|
||||
IsDataDescriptor: IsDataDescriptor,
|
||||
IsAccessorDescriptor: IsAccessorDescriptor
|
||||
}, desc) ? desc : ToPropertyDescriptor(desc);
|
||||
if (!isPropertyDescriptor({
|
||||
Type: Type,
|
||||
IsDataDescriptor: IsDataDescriptor,
|
||||
IsAccessorDescriptor: IsAccessorDescriptor
|
||||
}, Desc)) {
|
||||
throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');
|
||||
}
|
||||
|
||||
return DefineOwnProperty(
|
||||
IsDataDescriptor,
|
||||
SameValue,
|
||||
FromPropertyDescriptor,
|
||||
O,
|
||||
P,
|
||||
Desc
|
||||
);
|
||||
};
|
27
node_modules/es-abstract/2015/DeletePropertyOrThrow.js
generated
vendored
Normal file
27
node_modules/es-abstract/2015/DeletePropertyOrThrow.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow
|
||||
|
||||
module.exports = function DeletePropertyOrThrow(O, P) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
var success = delete O[P];
|
||||
if (!success) {
|
||||
throw new $TypeError('Attempt to delete property failed.');
|
||||
}
|
||||
return success;
|
||||
};
|
19
node_modules/es-abstract/2015/EnumerableOwnNames.js
generated
vendored
Normal file
19
node_modules/es-abstract/2015/EnumerableOwnNames.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var keys = require('object-keys');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames
|
||||
|
||||
module.exports = function EnumerableOwnNames(O) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
|
||||
return keys(O);
|
||||
};
|
36
node_modules/es-abstract/2015/FromPropertyDescriptor.js
generated
vendored
Normal file
36
node_modules/es-abstract/2015/FromPropertyDescriptor.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
var assertRecord = require('../helpers/assertRecord');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
|
||||
|
||||
module.exports = function FromPropertyDescriptor(Desc) {
|
||||
if (typeof Desc === 'undefined') {
|
||||
return Desc;
|
||||
}
|
||||
|
||||
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
|
||||
|
||||
var obj = {};
|
||||
if ('[[Value]]' in Desc) {
|
||||
obj.value = Desc['[[Value]]'];
|
||||
}
|
||||
if ('[[Writable]]' in Desc) {
|
||||
obj.writable = Desc['[[Writable]]'];
|
||||
}
|
||||
if ('[[Get]]' in Desc) {
|
||||
obj.get = Desc['[[Get]]'];
|
||||
}
|
||||
if ('[[Set]]' in Desc) {
|
||||
obj.set = Desc['[[Set]]'];
|
||||
}
|
||||
if ('[[Enumerable]]' in Desc) {
|
||||
obj.enumerable = Desc['[[Enumerable]]'];
|
||||
}
|
||||
if ('[[Configurable]]' in Desc) {
|
||||
obj.configurable = Desc['[[Configurable]]'];
|
||||
}
|
||||
return obj;
|
||||
};
|
30
node_modules/es-abstract/2015/Get.js
generated
vendored
Normal file
30
node_modules/es-abstract/2015/Get.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var inspect = require('object-inspect');
|
||||
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var Type = require('./Type');
|
||||
|
||||
/**
|
||||
* 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
|
||||
* 1. Assert: Type(O) is Object.
|
||||
* 2. Assert: IsPropertyKey(P) is true.
|
||||
* 3. Return O.[[Get]](P, O).
|
||||
*/
|
||||
|
||||
module.exports = function Get(O, P) {
|
||||
// 7.3.1.1
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
// 7.3.1.2
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));
|
||||
}
|
||||
// 7.3.1.3
|
||||
return O[P];
|
||||
};
|
35
node_modules/es-abstract/2015/GetIterator.js
generated
vendored
Normal file
35
node_modules/es-abstract/2015/GetIterator.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var getIteratorMethod = require('../helpers/getIteratorMethod');
|
||||
var AdvanceStringIndex = require('./AdvanceStringIndex');
|
||||
var Call = require('./Call');
|
||||
var GetMethod = require('./GetMethod');
|
||||
var IsArray = require('./IsArray');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-getiterator
|
||||
|
||||
module.exports = function GetIterator(obj, method) {
|
||||
var actualMethod = method;
|
||||
if (arguments.length < 2) {
|
||||
actualMethod = getIteratorMethod(
|
||||
{
|
||||
AdvanceStringIndex: AdvanceStringIndex,
|
||||
GetMethod: GetMethod,
|
||||
IsArray: IsArray,
|
||||
Type: Type
|
||||
},
|
||||
obj
|
||||
);
|
||||
}
|
||||
var iterator = Call(actualMethod, obj);
|
||||
if (Type(iterator) !== 'Object') {
|
||||
throw new $TypeError('iterator must return an object');
|
||||
}
|
||||
|
||||
return iterator;
|
||||
};
|
42
node_modules/es-abstract/2015/GetMethod.js
generated
vendored
Normal file
42
node_modules/es-abstract/2015/GetMethod.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var GetV = require('./GetV');
|
||||
var IsCallable = require('./IsCallable');
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
|
||||
/**
|
||||
* 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod
|
||||
* 1. Assert: IsPropertyKey(P) is true.
|
||||
* 2. Let func be GetV(O, P).
|
||||
* 3. ReturnIfAbrupt(func).
|
||||
* 4. If func is either undefined or null, return undefined.
|
||||
* 5. If IsCallable(func) is false, throw a TypeError exception.
|
||||
* 6. Return func.
|
||||
*/
|
||||
|
||||
module.exports = function GetMethod(O, P) {
|
||||
// 7.3.9.1
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
||||
}
|
||||
|
||||
// 7.3.9.2
|
||||
var func = GetV(O, P);
|
||||
|
||||
// 7.3.9.4
|
||||
if (func == null) {
|
||||
return void 0;
|
||||
}
|
||||
|
||||
// 7.3.9.5
|
||||
if (!IsCallable(func)) {
|
||||
throw new $TypeError(P + 'is not a function');
|
||||
}
|
||||
|
||||
// 7.3.9.6
|
||||
return func;
|
||||
};
|
31
node_modules/es-abstract/2015/GetOwnPropertyKeys.js
generated
vendored
Normal file
31
node_modules/es-abstract/2015/GetOwnPropertyKeys.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var hasSymbols = require('has-symbols')();
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%');
|
||||
var $gOPS = hasSymbols && GetIntrinsic('%Object.getOwnPropertySymbols%');
|
||||
var keys = require('object-keys');
|
||||
|
||||
var esType = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys
|
||||
|
||||
module.exports = function GetOwnPropertyKeys(O, Type) {
|
||||
if (esType(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
if (Type === 'Symbol') {
|
||||
return $gOPS ? $gOPS(O) : [];
|
||||
}
|
||||
if (Type === 'String') {
|
||||
if (!$gOPN) {
|
||||
return keys(O);
|
||||
}
|
||||
return $gOPN(O);
|
||||
}
|
||||
throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`');
|
||||
};
|
28
node_modules/es-abstract/2015/GetPrototypeFromConstructor.js
generated
vendored
Normal file
28
node_modules/es-abstract/2015/GetPrototypeFromConstructor.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $Function = GetIntrinsic('%Function%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Get = require('./Get');
|
||||
var IsConstructor = require('./IsConstructor');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor
|
||||
|
||||
module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) {
|
||||
var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic
|
||||
if (!IsConstructor(constructor)) {
|
||||
throw new $TypeError('Assertion failed: `constructor` must be a constructor');
|
||||
}
|
||||
var proto = Get(constructor, 'prototype');
|
||||
if (Type(proto) !== 'Object') {
|
||||
if (!(constructor instanceof $Function)) {
|
||||
// ignore other realms, for now
|
||||
throw new $TypeError('cross-realm constructors not currently supported');
|
||||
}
|
||||
proto = intrinsic;
|
||||
}
|
||||
return proto;
|
||||
};
|
104
node_modules/es-abstract/2015/GetSubstitution.js
generated
vendored
Normal file
104
node_modules/es-abstract/2015/GetSubstitution.js
generated
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $parseInt = GetIntrinsic('%parseInt%');
|
||||
|
||||
var inspect = require('object-inspect');
|
||||
|
||||
var regexTester = require('../helpers/regexTester');
|
||||
var callBound = require('../helpers/callBound');
|
||||
var every = require('../helpers/every');
|
||||
|
||||
var isDigit = regexTester(/^[0-9]$/);
|
||||
|
||||
var $charAt = callBound('String.prototype.charAt');
|
||||
var $strSlice = callBound('String.prototype.slice');
|
||||
|
||||
var IsArray = require('./IsArray');
|
||||
var IsInteger = require('./IsInteger');
|
||||
var Type = require('./Type');
|
||||
|
||||
var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false
|
||||
|
||||
var isStringOrHole = function (capture, index, arr) {
|
||||
return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined');
|
||||
};
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution
|
||||
|
||||
// eslint-disable-next-line max-statements, max-params, max-lines-per-function
|
||||
module.exports = function GetSubstitution(matched, str, position, captures, replacement) {
|
||||
if (Type(matched) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `matched` must be a String');
|
||||
}
|
||||
var matchLength = matched.length;
|
||||
|
||||
if (Type(str) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `str` must be a String');
|
||||
}
|
||||
var stringLength = str.length;
|
||||
|
||||
if (!IsInteger(position) || position < 0 || position > stringLength) {
|
||||
throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position));
|
||||
}
|
||||
|
||||
if (!IsArray(captures) || !every(captures, isStringOrHole)) {
|
||||
throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures));
|
||||
}
|
||||
|
||||
if (Type(replacement) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `replacement` must be a String');
|
||||
}
|
||||
|
||||
var tailPos = position + matchLength;
|
||||
var m = captures.length;
|
||||
|
||||
var result = '';
|
||||
for (var i = 0; i < replacement.length; i += 1) {
|
||||
// if this is a $, and it's not the end of the replacement
|
||||
var current = $charAt(replacement, i);
|
||||
var isLast = (i + 1) >= replacement.length;
|
||||
var nextIsLast = (i + 2) >= replacement.length;
|
||||
if (current === '$' && !isLast) {
|
||||
var next = $charAt(replacement, i + 1);
|
||||
if (next === '$') {
|
||||
result += '$';
|
||||
i += 1;
|
||||
} else if (next === '&') {
|
||||
result += matched;
|
||||
i += 1;
|
||||
} else if (next === '`') {
|
||||
result += position === 0 ? '' : $strSlice(str, 0, position - 1);
|
||||
i += 1;
|
||||
} else if (next === "'") {
|
||||
result += tailPos >= stringLength ? '' : $strSlice(str, tailPos);
|
||||
i += 1;
|
||||
} else {
|
||||
var nextNext = nextIsLast ? null : $charAt(replacement, i + 2);
|
||||
if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) {
|
||||
// $1 through $9, and not followed by a digit
|
||||
var n = $parseInt(next, 10);
|
||||
// if (n > m, impl-defined)
|
||||
result += (n <= m && Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1];
|
||||
i += 1;
|
||||
} else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) {
|
||||
// $00 through $99
|
||||
var nn = next + nextNext;
|
||||
var nnI = $parseInt(nn, 10) - 1;
|
||||
// if nn === '00' or nn > m, impl-defined
|
||||
result += (nn <= m && Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI];
|
||||
i += 2;
|
||||
} else {
|
||||
result += '$';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// the final $, or else not a $
|
||||
result += $charAt(replacement, i);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
29
node_modules/es-abstract/2015/GetV.js
generated
vendored
Normal file
29
node_modules/es-abstract/2015/GetV.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var ToObject = require('./ToObject');
|
||||
|
||||
/**
|
||||
* 7.3.2 GetV (V, P)
|
||||
* 1. Assert: IsPropertyKey(P) is true.
|
||||
* 2. Let O be ToObject(V).
|
||||
* 3. ReturnIfAbrupt(O).
|
||||
* 4. Return O.[[Get]](P, V).
|
||||
*/
|
||||
|
||||
module.exports = function GetV(V, P) {
|
||||
// 7.3.2.1
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
||||
}
|
||||
|
||||
// 7.3.2.2-3
|
||||
var O = ToObject(V);
|
||||
|
||||
// 7.3.2.4
|
||||
return O[P];
|
||||
};
|
22
node_modules/es-abstract/2015/HasOwnProperty.js
generated
vendored
Normal file
22
node_modules/es-abstract/2015/HasOwnProperty.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var has = require('has');
|
||||
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty
|
||||
|
||||
module.exports = function HasOwnProperty(O, P) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: `O` must be an Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: `P` must be a Property Key');
|
||||
}
|
||||
return has(O, P);
|
||||
};
|
20
node_modules/es-abstract/2015/HasProperty.js
generated
vendored
Normal file
20
node_modules/es-abstract/2015/HasProperty.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
|
||||
|
||||
module.exports = function HasProperty(O, P) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: `O` must be an Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: `P` must be a Property Key');
|
||||
}
|
||||
return P in O;
|
||||
};
|
16
node_modules/es-abstract/2015/HourFromTime.js
generated
vendored
Normal file
16
node_modules/es-abstract/2015/HourFromTime.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $floor = GetIntrinsic('%Math.floor%');
|
||||
|
||||
var mod = require('../helpers/mod');
|
||||
var timeConstants = require('../helpers/timeConstants');
|
||||
var msPerHour = timeConstants.msPerHour;
|
||||
var HoursPerDay = timeConstants.HoursPerDay;
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10
|
||||
|
||||
module.exports = function HourFromTime(t) {
|
||||
return mod($floor(t / msPerHour), HoursPerDay);
|
||||
};
|
21
node_modules/es-abstract/2015/InLeapYear.js
generated
vendored
Normal file
21
node_modules/es-abstract/2015/InLeapYear.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $EvalError = GetIntrinsic('%EvalError%');
|
||||
|
||||
var DaysInYear = require('./DaysInYear');
|
||||
var YearFromTime = require('./YearFromTime');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3
|
||||
|
||||
module.exports = function InLeapYear(t) {
|
||||
var days = DaysInYear(YearFromTime(t));
|
||||
if (days === 365) {
|
||||
return 0;
|
||||
}
|
||||
if (days === 366) {
|
||||
return 1;
|
||||
}
|
||||
throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days);
|
||||
};
|
30
node_modules/es-abstract/2015/InstanceofOperator.js
generated
vendored
Normal file
30
node_modules/es-abstract/2015/InstanceofOperator.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $hasInstance = GetIntrinsic('Symbol.hasInstance', true);
|
||||
|
||||
var Call = require('./Call');
|
||||
var GetMethod = require('./GetMethod');
|
||||
var IsCallable = require('./IsCallable');
|
||||
var OrdinaryHasInstance = require('./OrdinaryHasInstance');
|
||||
var ToBoolean = require('./ToBoolean');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator
|
||||
|
||||
module.exports = function InstanceofOperator(O, C) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0;
|
||||
if (typeof instOfHandler !== 'undefined') {
|
||||
return ToBoolean(Call(instOfHandler, C, [O]));
|
||||
}
|
||||
if (!IsCallable(C)) {
|
||||
throw new $TypeError('`C` is not Callable');
|
||||
}
|
||||
return OrdinaryHasInstance(C, O);
|
||||
};
|
22
node_modules/es-abstract/2015/Invoke.js
generated
vendored
Normal file
22
node_modules/es-abstract/2015/Invoke.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $arraySlice = require('../helpers/callBound')('Array.prototype.slice');
|
||||
|
||||
var Call = require('./Call');
|
||||
var GetV = require('./GetV');
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-invoke
|
||||
|
||||
module.exports = function Invoke(O, P) {
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('P must be a Property Key');
|
||||
}
|
||||
var argumentsList = $arraySlice(arguments, 2);
|
||||
var func = GetV(O, P);
|
||||
return Call(func, O, argumentsList);
|
||||
};
|
23
node_modules/es-abstract/2015/IsAccessorDescriptor.js
generated
vendored
Normal file
23
node_modules/es-abstract/2015/IsAccessorDescriptor.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
var has = require('has');
|
||||
|
||||
var assertRecord = require('../helpers/assertRecord');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor
|
||||
|
||||
module.exports = function IsAccessorDescriptor(Desc) {
|
||||
if (typeof Desc === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
|
||||
|
||||
if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
14
node_modules/es-abstract/2015/IsArray.js
generated
vendored
Normal file
14
node_modules/es-abstract/2015/IsArray.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $Array = GetIntrinsic('%Array%');
|
||||
|
||||
// eslint-disable-next-line global-require
|
||||
var toStr = !$Array.isArray && require('../helpers/callBound')('Object.prototype.toString');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray
|
||||
|
||||
module.exports = $Array.isArray || function IsArray(argument) {
|
||||
return toStr(argument) === '[object Array]';
|
||||
};
|
5
node_modules/es-abstract/2015/IsCallable.js
generated
vendored
Normal file
5
node_modules/es-abstract/2015/IsCallable.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11
|
||||
|
||||
module.exports = require('is-callable');
|
25
node_modules/es-abstract/2015/IsConcatSpreadable.js
generated
vendored
Normal file
25
node_modules/es-abstract/2015/IsConcatSpreadable.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true);
|
||||
|
||||
var Get = require('./Get');
|
||||
var IsArray = require('./IsArray');
|
||||
var ToBoolean = require('./ToBoolean');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable
|
||||
|
||||
module.exports = function IsConcatSpreadable(O) {
|
||||
if (Type(O) !== 'Object') {
|
||||
return false;
|
||||
}
|
||||
if ($isConcatSpreadable) {
|
||||
var spreadable = Get(O, $isConcatSpreadable);
|
||||
if (typeof spreadable !== 'undefined') {
|
||||
return ToBoolean(spreadable);
|
||||
}
|
||||
}
|
||||
return IsArray(O);
|
||||
};
|
7
node_modules/es-abstract/2015/IsConstructor.js
generated
vendored
Normal file
7
node_modules/es-abstract/2015/IsConstructor.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-isconstructor
|
||||
|
||||
module.exports = function IsConstructor(argument) {
|
||||
return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument`
|
||||
};
|
23
node_modules/es-abstract/2015/IsDataDescriptor.js
generated
vendored
Normal file
23
node_modules/es-abstract/2015/IsDataDescriptor.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
var has = require('has');
|
||||
|
||||
var assertRecord = require('../helpers/assertRecord');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
|
||||
|
||||
module.exports = function IsDataDescriptor(Desc) {
|
||||
if (typeof Desc === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
|
||||
|
||||
if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
20
node_modules/es-abstract/2015/IsExtensible.js
generated
vendored
Normal file
20
node_modules/es-abstract/2015/IsExtensible.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $Object = GetIntrinsic('%Object%');
|
||||
|
||||
var isPrimitive = require('../helpers/isPrimitive');
|
||||
|
||||
var $preventExtensions = $Object.preventExtensions;
|
||||
var $isExtensible = $Object.isExtensible;
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o
|
||||
|
||||
module.exports = $preventExtensions
|
||||
? function IsExtensible(obj) {
|
||||
return !isPrimitive(obj) && $isExtensible(obj);
|
||||
}
|
||||
: function IsExtensible(obj) {
|
||||
return !isPrimitive(obj);
|
||||
};
|
23
node_modules/es-abstract/2015/IsGenericDescriptor.js
generated
vendored
Normal file
23
node_modules/es-abstract/2015/IsGenericDescriptor.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
var assertRecord = require('../helpers/assertRecord');
|
||||
|
||||
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
|
||||
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor
|
||||
|
||||
module.exports = function IsGenericDescriptor(Desc) {
|
||||
if (typeof Desc === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
|
||||
|
||||
if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
21
node_modules/es-abstract/2015/IsInteger.js
generated
vendored
Normal file
21
node_modules/es-abstract/2015/IsInteger.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $Math = GetIntrinsic('%Math%');
|
||||
|
||||
var $floor = $Math.floor;
|
||||
var $abs = $Math.abs;
|
||||
|
||||
var $isNaN = require('../helpers/isNaN');
|
||||
var $isFinite = require('../helpers/isFinite');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-isinteger
|
||||
|
||||
module.exports = function IsInteger(argument) {
|
||||
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
|
||||
return false;
|
||||
}
|
||||
var abs = $abs(argument);
|
||||
return $floor(abs) === abs;
|
||||
};
|
24
node_modules/es-abstract/2015/IsPromise.js
generated
vendored
Normal file
24
node_modules/es-abstract/2015/IsPromise.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
var callBound = require('../helpers/callBound');
|
||||
|
||||
var $PromiseThen = callBound('Promise.prototype.then', true);
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise
|
||||
|
||||
module.exports = function IsPromise(x) {
|
||||
if (Type(x) !== 'Object') {
|
||||
return false;
|
||||
}
|
||||
if (!$PromiseThen) { // Promises are not supported
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$PromiseThen(x); // throws if not a promise
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
17
node_modules/es-abstract/2015/IsPropertyDescriptor.js
generated
vendored
Normal file
17
node_modules/es-abstract/2015/IsPropertyDescriptor.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
var isPropertyDescriptor = require('../helpers/isPropertyDescriptor');
|
||||
|
||||
var Type = require('./Type');
|
||||
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
|
||||
|
||||
module.exports = function IsPropertyDescriptor(Desc) {
|
||||
return isPropertyDescriptor({
|
||||
IsDataDescriptor: IsDataDescriptor,
|
||||
IsAccessorDescriptor: IsAccessorDescriptor,
|
||||
Type: Type
|
||||
}, Desc);
|
||||
};
|
7
node_modules/es-abstract/2015/IsPropertyKey.js
generated
vendored
Normal file
7
node_modules/es-abstract/2015/IsPropertyKey.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey
|
||||
|
||||
module.exports = function IsPropertyKey(argument) {
|
||||
return typeof argument === 'string' || typeof argument === 'symbol';
|
||||
};
|
24
node_modules/es-abstract/2015/IsRegExp.js
generated
vendored
Normal file
24
node_modules/es-abstract/2015/IsRegExp.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $match = GetIntrinsic('%Symbol.match%', true);
|
||||
|
||||
var hasRegExpMatcher = require('is-regex');
|
||||
|
||||
var ToBoolean = require('./ToBoolean');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-isregexp
|
||||
|
||||
module.exports = function IsRegExp(argument) {
|
||||
if (!argument || typeof argument !== 'object') {
|
||||
return false;
|
||||
}
|
||||
if ($match) {
|
||||
var isRegExp = argument[$match];
|
||||
if (typeof isRegExp !== 'undefined') {
|
||||
return ToBoolean(isRegExp);
|
||||
}
|
||||
}
|
||||
return hasRegExpMatcher(argument);
|
||||
};
|
50
node_modules/es-abstract/2015/IteratorClose.js
generated
vendored
Normal file
50
node_modules/es-abstract/2015/IteratorClose.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Call = require('./Call');
|
||||
var GetMethod = require('./GetMethod');
|
||||
var IsCallable = require('./IsCallable');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose
|
||||
|
||||
module.exports = function IteratorClose(iterator, completion) {
|
||||
if (Type(iterator) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(iterator) is not Object');
|
||||
}
|
||||
if (!IsCallable(completion)) {
|
||||
throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record');
|
||||
}
|
||||
var completionThunk = completion;
|
||||
|
||||
var iteratorReturn = GetMethod(iterator, 'return');
|
||||
|
||||
if (typeof iteratorReturn === 'undefined') {
|
||||
return completionThunk();
|
||||
}
|
||||
|
||||
var completionRecord;
|
||||
try {
|
||||
var innerResult = Call(iteratorReturn, iterator, []);
|
||||
} catch (e) {
|
||||
// if we hit here, then "e" is the innerResult completion that needs re-throwing
|
||||
|
||||
// if the completion is of type "throw", this will throw.
|
||||
completionThunk();
|
||||
completionThunk = null; // ensure it's not called twice.
|
||||
|
||||
// if not, then return the innerResult completion
|
||||
throw e;
|
||||
}
|
||||
completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does
|
||||
completionThunk = null; // ensure it's not called twice.
|
||||
|
||||
if (Type(innerResult) !== 'Object') {
|
||||
throw new $TypeError('iterator .return must return an object');
|
||||
}
|
||||
|
||||
return completionRecord;
|
||||
};
|
18
node_modules/es-abstract/2015/IteratorComplete.js
generated
vendored
Normal file
18
node_modules/es-abstract/2015/IteratorComplete.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Get = require('./Get');
|
||||
var ToBoolean = require('./ToBoolean');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete
|
||||
|
||||
module.exports = function IteratorComplete(iterResult) {
|
||||
if (Type(iterResult) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
|
||||
}
|
||||
return ToBoolean(Get(iterResult, 'done'));
|
||||
};
|
18
node_modules/es-abstract/2015/IteratorNext.js
generated
vendored
Normal file
18
node_modules/es-abstract/2015/IteratorNext.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Invoke = require('./Invoke');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext
|
||||
|
||||
module.exports = function IteratorNext(iterator, value) {
|
||||
var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]);
|
||||
if (Type(result) !== 'Object') {
|
||||
throw new $TypeError('iterator next must return an object');
|
||||
}
|
||||
return result;
|
||||
};
|
13
node_modules/es-abstract/2015/IteratorStep.js
generated
vendored
Normal file
13
node_modules/es-abstract/2015/IteratorStep.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var IteratorComplete = require('./IteratorComplete');
|
||||
var IteratorNext = require('./IteratorNext');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep
|
||||
|
||||
module.exports = function IteratorStep(iterator) {
|
||||
var result = IteratorNext(iterator);
|
||||
var done = IteratorComplete(result);
|
||||
return done === true ? false : result;
|
||||
};
|
||||
|
18
node_modules/es-abstract/2015/IteratorValue.js
generated
vendored
Normal file
18
node_modules/es-abstract/2015/IteratorValue.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Get = require('./Get');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue
|
||||
|
||||
module.exports = function IteratorValue(iterResult) {
|
||||
if (Type(iterResult) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
|
||||
}
|
||||
return Get(iterResult, 'value');
|
||||
};
|
||||
|
13
node_modules/es-abstract/2015/MakeDate.js
generated
vendored
Normal file
13
node_modules/es-abstract/2015/MakeDate.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var $isFinite = require('../helpers/isFinite');
|
||||
var msPerDay = require('../helpers/timeConstants').msPerDay;
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13
|
||||
|
||||
module.exports = function MakeDate(day, time) {
|
||||
if (!$isFinite(day) || !$isFinite(time)) {
|
||||
return NaN;
|
||||
}
|
||||
return (day * msPerDay) + time;
|
||||
};
|
33
node_modules/es-abstract/2015/MakeDay.js
generated
vendored
Normal file
33
node_modules/es-abstract/2015/MakeDay.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $floor = GetIntrinsic('%Math.floor%');
|
||||
var $DateUTC = GetIntrinsic('%Date.UTC%');
|
||||
|
||||
var mod = require('../helpers/mod');
|
||||
var $isFinite = require('../helpers/isFinite');
|
||||
|
||||
var DateFromTime = require('./DateFromTime');
|
||||
var Day = require('./Day');
|
||||
var MonthFromTime = require('./MonthFromTime');
|
||||
var ToInteger = require('./ToInteger');
|
||||
var YearFromTime = require('./YearFromTime');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12
|
||||
|
||||
module.exports = function MakeDay(year, month, date) {
|
||||
if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) {
|
||||
return NaN;
|
||||
}
|
||||
var y = ToInteger(year);
|
||||
var m = ToInteger(month);
|
||||
var dt = ToInteger(date);
|
||||
var ym = y + $floor(m / 12);
|
||||
var mn = mod(m, 12);
|
||||
var t = $DateUTC(ym, mn, 1);
|
||||
if (YearFromTime(t) !== ym || MonthFromTime(t) !== mn || DateFromTime(t) !== 1) {
|
||||
return NaN;
|
||||
}
|
||||
return Day(t) + dt - 1;
|
||||
};
|
23
node_modules/es-abstract/2015/MakeTime.js
generated
vendored
Normal file
23
node_modules/es-abstract/2015/MakeTime.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
var $isFinite = require('../helpers/isFinite');
|
||||
var timeConstants = require('../helpers/timeConstants');
|
||||
var msPerSecond = timeConstants.msPerSecond;
|
||||
var msPerMinute = timeConstants.msPerMinute;
|
||||
var msPerHour = timeConstants.msPerHour;
|
||||
|
||||
var ToInteger = require('./ToInteger');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11
|
||||
|
||||
module.exports = function MakeTime(hour, min, sec, ms) {
|
||||
if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) {
|
||||
return NaN;
|
||||
}
|
||||
var h = ToInteger(hour);
|
||||
var m = ToInteger(min);
|
||||
var s = ToInteger(sec);
|
||||
var milli = ToInteger(ms);
|
||||
var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli;
|
||||
return t;
|
||||
};
|
16
node_modules/es-abstract/2015/MinFromTime.js
generated
vendored
Normal file
16
node_modules/es-abstract/2015/MinFromTime.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $floor = GetIntrinsic('%Math.floor%');
|
||||
|
||||
var mod = require('../helpers/mod');
|
||||
var timeConstants = require('../helpers/timeConstants');
|
||||
var msPerMinute = timeConstants.msPerMinute;
|
||||
var MinutesPerHour = timeConstants.MinutesPerHour;
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10
|
||||
|
||||
module.exports = function MinFromTime(t) {
|
||||
return mod($floor(t / msPerMinute), MinutesPerHour);
|
||||
};
|
47
node_modules/es-abstract/2015/MonthFromTime.js
generated
vendored
Normal file
47
node_modules/es-abstract/2015/MonthFromTime.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
var DayWithinYear = require('./DayWithinYear');
|
||||
var InLeapYear = require('./InLeapYear');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4
|
||||
|
||||
module.exports = function MonthFromTime(t) {
|
||||
var day = DayWithinYear(t);
|
||||
if (0 <= day && day < 31) {
|
||||
return 0;
|
||||
}
|
||||
var leap = InLeapYear(t);
|
||||
if (31 <= day && day < (59 + leap)) {
|
||||
return 1;
|
||||
}
|
||||
if ((59 + leap) <= day && day < (90 + leap)) {
|
||||
return 2;
|
||||
}
|
||||
if ((90 + leap) <= day && day < (120 + leap)) {
|
||||
return 3;
|
||||
}
|
||||
if ((120 + leap) <= day && day < (151 + leap)) {
|
||||
return 4;
|
||||
}
|
||||
if ((151 + leap) <= day && day < (181 + leap)) {
|
||||
return 5;
|
||||
}
|
||||
if ((181 + leap) <= day && day < (212 + leap)) {
|
||||
return 6;
|
||||
}
|
||||
if ((212 + leap) <= day && day < (243 + leap)) {
|
||||
return 7;
|
||||
}
|
||||
if ((243 + leap) <= day && day < (273 + leap)) {
|
||||
return 8;
|
||||
}
|
||||
if ((273 + leap) <= day && day < (304 + leap)) {
|
||||
return 9;
|
||||
}
|
||||
if ((304 + leap) <= day && day < (334 + leap)) {
|
||||
return 10;
|
||||
}
|
||||
if ((334 + leap) <= day && day < (365 + leap)) {
|
||||
return 11;
|
||||
}
|
||||
};
|
37
node_modules/es-abstract/2015/ObjectCreate.js
generated
vendored
Normal file
37
node_modules/es-abstract/2015/ObjectCreate.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $ObjectCreate = GetIntrinsic('%Object.create%', true);
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
var hasProto = !({ __proto__: null } instanceof Object);
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate
|
||||
|
||||
module.exports = function ObjectCreate(proto, internalSlotsList) {
|
||||
if (proto !== null && Type(proto) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: `proto` must be null or an object');
|
||||
}
|
||||
var slots = arguments.length < 2 ? [] : internalSlotsList;
|
||||
if (slots.length > 0) {
|
||||
throw new $SyntaxError('es-abstract does not yet support internal slots');
|
||||
}
|
||||
|
||||
if ($ObjectCreate) {
|
||||
return $ObjectCreate(proto);
|
||||
}
|
||||
if (hasProto) {
|
||||
return { __proto__: proto };
|
||||
}
|
||||
|
||||
if (proto === null) {
|
||||
throw new $SyntaxError('native Object.create support is required to create null objects');
|
||||
}
|
||||
var T = function T() {};
|
||||
T.prototype = proto;
|
||||
return new T();
|
||||
};
|
61
node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js
generated
vendored
Normal file
61
node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $gOPD = require('../helpers/getOwnPropertyDescriptor');
|
||||
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var isPropertyDescriptor = require('../helpers/isPropertyDescriptor');
|
||||
|
||||
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
|
||||
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||
var IsExtensible = require('./IsExtensible');
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
|
||||
var SameValue = require('./SameValue');
|
||||
var Type = require('./Type');
|
||||
var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty
|
||||
|
||||
module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: O must be an Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: P must be a Property Key');
|
||||
}
|
||||
if (!isPropertyDescriptor({
|
||||
Type: Type,
|
||||
IsDataDescriptor: IsDataDescriptor,
|
||||
IsAccessorDescriptor: IsAccessorDescriptor
|
||||
}, Desc)) {
|
||||
throw new $TypeError('Assertion failed: Desc must be a Property Descriptor');
|
||||
}
|
||||
if (!$gOPD) {
|
||||
// ES3/IE 8 fallback
|
||||
if (IsAccessorDescriptor(Desc)) {
|
||||
throw new $SyntaxError('This environment does not support accessor property descriptors.');
|
||||
}
|
||||
var creatingNormalDataProperty = !(P in O)
|
||||
&& Desc['[[Writable]]']
|
||||
&& Desc['[[Enumerable]]']
|
||||
&& Desc['[[Configurable]]']
|
||||
&& '[[Value]]' in Desc;
|
||||
var settingExistingDataProperty = (P in O)
|
||||
&& (!('[[Configurable]]' in Desc) || Desc['[[Configurable]]'])
|
||||
&& (!('[[Enumerable]]' in Desc) || Desc['[[Enumerable]]'])
|
||||
&& (!('[[Writable]]' in Desc) || Desc['[[Writable]]'])
|
||||
&& '[[Value]]' in Desc;
|
||||
if (creatingNormalDataProperty || settingExistingDataProperty) {
|
||||
O[P] = Desc['[[Value]]']; // eslint-disable-line no-param-reassign
|
||||
return SameValue(O[P], Desc['[[Value]]']);
|
||||
}
|
||||
throw new $SyntaxError('This environment does not support defining non-writable, non-enumerable, or non-configurable properties');
|
||||
}
|
||||
var desc = $gOPD(O, P);
|
||||
var current = desc && ToPropertyDescriptor(desc);
|
||||
var extensible = IsExtensible(O);
|
||||
return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current);
|
||||
};
|
44
node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js
generated
vendored
Normal file
44
node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $gOPD = require('../helpers/getOwnPropertyDescriptor');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var callBound = require('../helpers/callBound');
|
||||
|
||||
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
||||
|
||||
var has = require('has');
|
||||
|
||||
var IsArray = require('./IsArray');
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var IsRegExp = require('./IsRegExp');
|
||||
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
|
||||
|
||||
module.exports = function OrdinaryGetOwnProperty(O, P) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: O must be an Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: P must be a Property Key');
|
||||
}
|
||||
if (!has(O, P)) {
|
||||
return void 0;
|
||||
}
|
||||
if (!$gOPD) {
|
||||
// ES3 / IE 8 fallback
|
||||
var arrayLength = IsArray(O) && P === 'length';
|
||||
var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
|
||||
return {
|
||||
'[[Configurable]]': !(arrayLength || regexLastIndex),
|
||||
'[[Enumerable]]': $isEnumerable(O, P),
|
||||
'[[Value]]': O[P],
|
||||
'[[Writable]]': true
|
||||
};
|
||||
}
|
||||
return ToPropertyDescriptor($gOPD(O, P));
|
||||
};
|
25
node_modules/es-abstract/2015/OrdinaryHasInstance.js
generated
vendored
Normal file
25
node_modules/es-abstract/2015/OrdinaryHasInstance.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Get = require('./Get');
|
||||
var IsCallable = require('./IsCallable');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance
|
||||
|
||||
module.exports = function OrdinaryHasInstance(C, O) {
|
||||
if (IsCallable(C) === false) {
|
||||
return false;
|
||||
}
|
||||
if (Type(O) !== 'Object') {
|
||||
return false;
|
||||
}
|
||||
var P = Get(C, 'prototype');
|
||||
if (Type(P) !== 'Object') {
|
||||
throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');
|
||||
}
|
||||
return O instanceof C;
|
||||
};
|
20
node_modules/es-abstract/2015/OrdinaryHasProperty.js
generated
vendored
Normal file
20
node_modules/es-abstract/2015/OrdinaryHasProperty.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty
|
||||
|
||||
module.exports = function OrdinaryHasProperty(O, P) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: P must be a Property Key');
|
||||
}
|
||||
return P in O;
|
||||
};
|
32
node_modules/es-abstract/2015/RegExpExec.js
generated
vendored
Normal file
32
node_modules/es-abstract/2015/RegExpExec.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var regexExec = require('../helpers/callBound')('RegExp.prototype.exec');
|
||||
|
||||
var Call = require('./Call');
|
||||
var Get = require('./Get');
|
||||
var IsCallable = require('./IsCallable');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec
|
||||
|
||||
module.exports = function RegExpExec(R, S) {
|
||||
if (Type(R) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: `R` must be an Object');
|
||||
}
|
||||
if (Type(S) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `S` must be a String');
|
||||
}
|
||||
var exec = Get(R, 'exec');
|
||||
if (IsCallable(exec)) {
|
||||
var result = Call(exec, R, [S]);
|
||||
if (result === null || Type(result) === 'Object') {
|
||||
return result;
|
||||
}
|
||||
throw new $TypeError('"exec" method must return `null` or an Object');
|
||||
}
|
||||
return regexExec(R, S);
|
||||
};
|
3
node_modules/es-abstract/2015/RequireObjectCoercible.js
generated
vendored
Normal file
3
node_modules/es-abstract/2015/RequireObjectCoercible.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('../5/CheckObjectCoercible');
|
13
node_modules/es-abstract/2015/SameValue.js
generated
vendored
Normal file
13
node_modules/es-abstract/2015/SameValue.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var $isNaN = require('../helpers/isNaN');
|
||||
|
||||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12
|
||||
|
||||
module.exports = function SameValue(x, y) {
|
||||
if (x === y) { // 0 === -0, but they are not identical.
|
||||
if (x === 0) { return 1 / x === 1 / y; }
|
||||
return true;
|
||||
}
|
||||
return $isNaN(x) && $isNaN(y);
|
||||
};
|
9
node_modules/es-abstract/2015/SameValueZero.js
generated
vendored
Normal file
9
node_modules/es-abstract/2015/SameValueZero.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
var $isNaN = require('../helpers/isNaN');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero
|
||||
|
||||
module.exports = function SameValueZero(x, y) {
|
||||
return (x === y) || ($isNaN(x) && $isNaN(y));
|
||||
};
|
16
node_modules/es-abstract/2015/SecFromTime.js
generated
vendored
Normal file
16
node_modules/es-abstract/2015/SecFromTime.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $floor = GetIntrinsic('%Math.floor%');
|
||||
|
||||
var mod = require('../helpers/mod');
|
||||
var timeConstants = require('../helpers/timeConstants');
|
||||
var msPerSecond = timeConstants.msPerSecond;
|
||||
var SecondsPerMinute = timeConstants.SecondsPerMinute;
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10
|
||||
|
||||
module.exports = function SecFromTime(t) {
|
||||
return mod($floor(t / msPerSecond), SecondsPerMinute);
|
||||
};
|
32
node_modules/es-abstract/2015/Set.js
generated
vendored
Normal file
32
node_modules/es-abstract/2015/Set.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw
|
||||
|
||||
module.exports = function Set(O, P, V, Throw) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: `O` must be an Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: `P` must be a Property Key');
|
||||
}
|
||||
if (Type(Throw) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: `Throw` must be a Boolean');
|
||||
}
|
||||
if (Throw) {
|
||||
O[P] = V; // eslint-disable-line no-param-reassign
|
||||
return true;
|
||||
} else {
|
||||
try {
|
||||
O[P] = V; // eslint-disable-line no-param-reassign
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
44
node_modules/es-abstract/2015/SetFunctionName.js
generated
vendored
Normal file
44
node_modules/es-abstract/2015/SetFunctionName.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var has = require('has');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var getSymbolDescription = require('../helpers/getSymbolDescription');
|
||||
|
||||
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
|
||||
var IsExtensible = require('./IsExtensible');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname
|
||||
|
||||
module.exports = function SetFunctionName(F, name) {
|
||||
if (typeof F !== 'function') {
|
||||
throw new $TypeError('Assertion failed: `F` must be a function');
|
||||
}
|
||||
if (!IsExtensible(F) || has(F, 'name')) {
|
||||
throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property');
|
||||
}
|
||||
var nameType = Type(name);
|
||||
if (nameType !== 'Symbol' && nameType !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `name` must be a Symbol or a String');
|
||||
}
|
||||
if (nameType === 'Symbol') {
|
||||
var description = getSymbolDescription(name);
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
name = typeof description === 'undefined' ? '' : '[' + description + ']';
|
||||
}
|
||||
if (arguments.length > 2) {
|
||||
var prefix = arguments[2];
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
name = prefix + ' ' + name;
|
||||
}
|
||||
return DefinePropertyOrThrow(F, 'name', {
|
||||
'[[Value]]': name,
|
||||
'[[Writable]]': false,
|
||||
'[[Enumerable]]': false,
|
||||
'[[Configurable]]': true
|
||||
});
|
||||
};
|
57
node_modules/es-abstract/2015/SetIntegrityLevel.js
generated
vendored
Normal file
57
node_modules/es-abstract/2015/SetIntegrityLevel.js
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $preventExtensions = GetIntrinsic('%Object.preventExtensions%');
|
||||
var $gOPD = require('../helpers/getOwnPropertyDescriptor');
|
||||
var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%');
|
||||
|
||||
var forEach = require('../helpers/forEach');
|
||||
|
||||
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
|
||||
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
|
||||
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel
|
||||
|
||||
module.exports = function SetIntegrityLevel(O, level) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
if (level !== 'sealed' && level !== 'frozen') {
|
||||
throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`');
|
||||
}
|
||||
if (!$preventExtensions) {
|
||||
throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support');
|
||||
}
|
||||
var status = $preventExtensions(O);
|
||||
if (!status) {
|
||||
return false;
|
||||
}
|
||||
if (!$gOPN) {
|
||||
throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support');
|
||||
}
|
||||
var theKeys = $gOPN(O);
|
||||
if (level === 'sealed') {
|
||||
forEach(theKeys, function (k) {
|
||||
DefinePropertyOrThrow(O, k, { configurable: false });
|
||||
});
|
||||
} else if (level === 'frozen') {
|
||||
forEach(theKeys, function (k) {
|
||||
var currentDesc = $gOPD(O, k);
|
||||
if (typeof currentDesc !== 'undefined') {
|
||||
var desc;
|
||||
if (IsAccessorDescriptor(ToPropertyDescriptor(currentDesc))) {
|
||||
desc = { configurable: false };
|
||||
} else {
|
||||
desc = { configurable: false, writable: false };
|
||||
}
|
||||
DefinePropertyOrThrow(O, k, desc);
|
||||
}
|
||||
});
|
||||
}
|
||||
return true;
|
||||
};
|
32
node_modules/es-abstract/2015/SpeciesConstructor.js
generated
vendored
Normal file
32
node_modules/es-abstract/2015/SpeciesConstructor.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $species = GetIntrinsic('%Symbol.species%', true);
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsConstructor = require('./IsConstructor');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor
|
||||
|
||||
module.exports = function SpeciesConstructor(O, defaultConstructor) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
var C = O.constructor;
|
||||
if (typeof C === 'undefined') {
|
||||
return defaultConstructor;
|
||||
}
|
||||
if (Type(C) !== 'Object') {
|
||||
throw new $TypeError('O.constructor is not an Object');
|
||||
}
|
||||
var S = $species ? C[$species] : void 0;
|
||||
if (S == null) {
|
||||
return defaultConstructor;
|
||||
}
|
||||
if (IsConstructor(S)) {
|
||||
return S;
|
||||
}
|
||||
throw new $TypeError('no constructor found');
|
||||
};
|
17
node_modules/es-abstract/2015/StrictEqualityComparison.js
generated
vendored
Normal file
17
node_modules/es-abstract/2015/StrictEqualityComparison.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6
|
||||
|
||||
module.exports = function StrictEqualityComparison(x, y) {
|
||||
var xType = Type(x);
|
||||
var yType = Type(y);
|
||||
if (xType !== yType) {
|
||||
return false;
|
||||
}
|
||||
if (xType === 'Undefined' || xType === 'Null') {
|
||||
return true;
|
||||
}
|
||||
return x === y; // shortcut for steps 4-7
|
||||
};
|
20
node_modules/es-abstract/2015/SymbolDescriptiveString.js
generated
vendored
Normal file
20
node_modules/es-abstract/2015/SymbolDescriptiveString.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var callBound = require('../helpers/callBound');
|
||||
|
||||
var $SymbolToString = callBound('Symbol.prototype.toString', true);
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring
|
||||
|
||||
module.exports = function SymbolDescriptiveString(sym) {
|
||||
if (Type(sym) !== 'Symbol') {
|
||||
throw new $TypeError('Assertion failed: `sym` must be a Symbol');
|
||||
}
|
||||
return $SymbolToString(sym);
|
||||
};
|
42
node_modules/es-abstract/2015/TestIntegrityLevel.js
generated
vendored
Normal file
42
node_modules/es-abstract/2015/TestIntegrityLevel.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $gOPD = require('../helpers/getOwnPropertyDescriptor');
|
||||
var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var every = require('../helpers/every');
|
||||
|
||||
var IsDataDescriptor = require('./IsDataDescriptor');
|
||||
var IsExtensible = require('./IsExtensible');
|
||||
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel
|
||||
|
||||
module.exports = function TestIntegrityLevel(O, level) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
if (level !== 'sealed' && level !== 'frozen') {
|
||||
throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`');
|
||||
}
|
||||
var status = IsExtensible(O);
|
||||
if (status) {
|
||||
return false;
|
||||
}
|
||||
var theKeys = $gOPN(O);
|
||||
return theKeys.length === 0 || every(theKeys, function (k) {
|
||||
var currentDesc = $gOPD(O, k);
|
||||
if (typeof currentDesc !== 'undefined') {
|
||||
if (currentDesc.configurable) {
|
||||
return false;
|
||||
}
|
||||
if (level === 'frozen' && IsDataDescriptor(ToPropertyDescriptor(currentDesc)) && currentDesc.writable) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
21
node_modules/es-abstract/2015/TimeClip.js
generated
vendored
Normal file
21
node_modules/es-abstract/2015/TimeClip.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $Date = GetIntrinsic('%Date%');
|
||||
var $Number = GetIntrinsic('%Number%');
|
||||
var $abs = GetIntrinsic('%Math.abs%');
|
||||
|
||||
var $isFinite = require('../helpers/isFinite');
|
||||
|
||||
var ToNumber = require('./ToNumber');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14
|
||||
|
||||
module.exports = function TimeClip(time) {
|
||||
if (!$isFinite(time) || $abs(time) > 8.64e15) {
|
||||
return NaN;
|
||||
}
|
||||
return $Number(new $Date(ToNumber(time)));
|
||||
};
|
||||
|
11
node_modules/es-abstract/2015/TimeFromYear.js
generated
vendored
Normal file
11
node_modules/es-abstract/2015/TimeFromYear.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
var msPerDay = require('../helpers/timeConstants').msPerDay;
|
||||
|
||||
var DayFromYear = require('./DayFromYear');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3
|
||||
|
||||
module.exports = function TimeFromYear(y) {
|
||||
return msPerDay * DayFromYear(y);
|
||||
};
|
11
node_modules/es-abstract/2015/TimeWithinDay.js
generated
vendored
Normal file
11
node_modules/es-abstract/2015/TimeWithinDay.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
var mod = require('../helpers/mod');
|
||||
var msPerDay = require('../helpers/timeConstants').msPerDay;
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2
|
||||
|
||||
module.exports = function TimeWithinDay(t) {
|
||||
return mod(t, msPerDay);
|
||||
};
|
||||
|
5
node_modules/es-abstract/2015/ToBoolean.js
generated
vendored
Normal file
5
node_modules/es-abstract/2015/ToBoolean.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2
|
||||
|
||||
module.exports = function ToBoolean(value) { return !!value; };
|
22
node_modules/es-abstract/2015/ToDateString.js
generated
vendored
Normal file
22
node_modules/es-abstract/2015/ToDateString.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $Date = GetIntrinsic('%Date%');
|
||||
|
||||
var $isNaN = require('../helpers/isNaN');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-todatestring
|
||||
|
||||
module.exports = function ToDateString(tv) {
|
||||
if (Type(tv) !== 'Number') {
|
||||
throw new $TypeError('Assertion failed: `tv` must be a Number');
|
||||
}
|
||||
if ($isNaN(tv)) {
|
||||
return 'Invalid Date';
|
||||
}
|
||||
return $Date(tv);
|
||||
};
|
10
node_modules/es-abstract/2015/ToInt16.js
generated
vendored
Normal file
10
node_modules/es-abstract/2015/ToInt16.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var ToUint16 = require('./ToUint16');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-toint16
|
||||
|
||||
module.exports = function ToInt16(argument) {
|
||||
var int16bit = ToUint16(argument);
|
||||
return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit;
|
||||
};
|
9
node_modules/es-abstract/2015/ToInt32.js
generated
vendored
Normal file
9
node_modules/es-abstract/2015/ToInt32.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
var ToNumber = require('./ToNumber');
|
||||
|
||||
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.5
|
||||
|
||||
module.exports = function ToInt32(x) {
|
||||
return ToNumber(x) >> 0;
|
||||
};
|
10
node_modules/es-abstract/2015/ToInt8.js
generated
vendored
Normal file
10
node_modules/es-abstract/2015/ToInt8.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var ToUint8 = require('./ToUint8');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-toint8
|
||||
|
||||
module.exports = function ToInt8(argument) {
|
||||
var int8bit = ToUint8(argument);
|
||||
return int8bit >= 0x80 ? int8bit - 0x100 : int8bit;
|
||||
};
|
12
node_modules/es-abstract/2015/ToInteger.js
generated
vendored
Normal file
12
node_modules/es-abstract/2015/ToInteger.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
var ES5ToInteger = require('../5/ToInteger');
|
||||
|
||||
var ToNumber = require('./ToNumber');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger
|
||||
|
||||
module.exports = function ToInteger(value) {
|
||||
var number = ToNumber(value);
|
||||
return ES5ToInteger(number);
|
||||
};
|
12
node_modules/es-abstract/2015/ToLength.js
generated
vendored
Normal file
12
node_modules/es-abstract/2015/ToLength.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
|
||||
|
||||
var ToInteger = require('./ToInteger');
|
||||
|
||||
module.exports = function ToLength(argument) {
|
||||
var len = ToInteger(argument);
|
||||
if (len <= 0) { return 0; } // includes converting -0 to +0
|
||||
if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
|
||||
return len;
|
||||
};
|
59
node_modules/es-abstract/2015/ToNumber.js
generated
vendored
Normal file
59
node_modules/es-abstract/2015/ToNumber.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $Number = GetIntrinsic('%Number%');
|
||||
var $RegExp = GetIntrinsic('%RegExp%');
|
||||
var $parseInteger = GetIntrinsic('%parseInt%');
|
||||
|
||||
var callBound = require('../helpers/callBound');
|
||||
var regexTester = require('../helpers/regexTester');
|
||||
var isPrimitive = require('../helpers/isPrimitive');
|
||||
|
||||
var $strSlice = callBound('String.prototype.slice');
|
||||
var isBinary = regexTester(/^0b[01]+$/i);
|
||||
var isOctal = regexTester(/^0o[0-7]+$/i);
|
||||
var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);
|
||||
var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
|
||||
var nonWSregex = new $RegExp('[' + nonWS + ']', 'g');
|
||||
var hasNonWS = regexTester(nonWSregex);
|
||||
|
||||
// whitespace from: https://es5.github.io/#x15.5.4.20
|
||||
// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324
|
||||
var ws = [
|
||||
'\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003',
|
||||
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028',
|
||||
'\u2029\uFEFF'
|
||||
].join('');
|
||||
var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
|
||||
var $replace = callBound('String.prototype.replace');
|
||||
var $trim = function (value) {
|
||||
return $replace(value, trimRegex, '');
|
||||
};
|
||||
|
||||
var ToPrimitive = require('./ToPrimitive');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber
|
||||
|
||||
module.exports = function ToNumber(argument) {
|
||||
var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);
|
||||
if (typeof value === 'symbol') {
|
||||
throw new $TypeError('Cannot convert a Symbol value to a number');
|
||||
}
|
||||
if (typeof value === 'string') {
|
||||
if (isBinary(value)) {
|
||||
return ToNumber($parseInteger($strSlice(value, 2), 2));
|
||||
} else if (isOctal(value)) {
|
||||
return ToNumber($parseInteger($strSlice(value, 2), 8));
|
||||
} else if (hasNonWS(value) || isInvalidHexLiteral(value)) {
|
||||
return NaN;
|
||||
} else {
|
||||
var trimmed = $trim(value);
|
||||
if (trimmed !== value) {
|
||||
return ToNumber(trimmed);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $Number(value);
|
||||
};
|
14
node_modules/es-abstract/2015/ToObject.js
generated
vendored
Normal file
14
node_modules/es-abstract/2015/ToObject.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $Object = GetIntrinsic('%Object%');
|
||||
|
||||
var RequireObjectCoercible = require('./RequireObjectCoercible');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject
|
||||
|
||||
module.exports = function ToObject(value) {
|
||||
RequireObjectCoercible(value);
|
||||
return $Object(value);
|
||||
};
|
12
node_modules/es-abstract/2015/ToPrimitive.js
generated
vendored
Normal file
12
node_modules/es-abstract/2015/ToPrimitive.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
var toPrimitive = require('es-to-primitive/es2015');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive
|
||||
|
||||
module.exports = function ToPrimitive(input) {
|
||||
if (arguments.length > 1) {
|
||||
return toPrimitive(input, arguments[1]);
|
||||
}
|
||||
return toPrimitive(input);
|
||||
};
|
52
node_modules/es-abstract/2015/ToPropertyDescriptor.js
generated
vendored
Normal file
52
node_modules/es-abstract/2015/ToPropertyDescriptor.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
var has = require('has');
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Type = require('./Type');
|
||||
var ToBoolean = require('./ToBoolean');
|
||||
var IsCallable = require('./IsCallable');
|
||||
|
||||
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5
|
||||
|
||||
module.exports = function ToPropertyDescriptor(Obj) {
|
||||
if (Type(Obj) !== 'Object') {
|
||||
throw new $TypeError('ToPropertyDescriptor requires an object');
|
||||
}
|
||||
|
||||
var desc = {};
|
||||
if (has(Obj, 'enumerable')) {
|
||||
desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
|
||||
}
|
||||
if (has(Obj, 'configurable')) {
|
||||
desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
|
||||
}
|
||||
if (has(Obj, 'value')) {
|
||||
desc['[[Value]]'] = Obj.value;
|
||||
}
|
||||
if (has(Obj, 'writable')) {
|
||||
desc['[[Writable]]'] = ToBoolean(Obj.writable);
|
||||
}
|
||||
if (has(Obj, 'get')) {
|
||||
var getter = Obj.get;
|
||||
if (typeof getter !== 'undefined' && !IsCallable(getter)) {
|
||||
throw new TypeError('getter must be a function');
|
||||
}
|
||||
desc['[[Get]]'] = getter;
|
||||
}
|
||||
if (has(Obj, 'set')) {
|
||||
var setter = Obj.set;
|
||||
if (typeof setter !== 'undefined' && !IsCallable(setter)) {
|
||||
throw new $TypeError('setter must be a function');
|
||||
}
|
||||
desc['[[Set]]'] = setter;
|
||||
}
|
||||
|
||||
if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
|
||||
throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
|
||||
}
|
||||
return desc;
|
||||
};
|
15
node_modules/es-abstract/2015/ToPropertyKey.js
generated
vendored
Normal file
15
node_modules/es-abstract/2015/ToPropertyKey.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../GetIntrinsic');
|
||||
|
||||
var $String = GetIntrinsic('%String%');
|
||||
|
||||
var ToPrimitive = require('./ToPrimitive');
|
||||
var ToString = require('./ToString');
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey
|
||||
|
||||
module.exports = function ToPropertyKey(argument) {
|
||||
var key = ToPrimitive(argument, $String);
|
||||
return typeof key === 'symbol' ? key : ToString(key);
|
||||
};
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user