Bump the npm group with 2 updates (#1819)

* Bump the npm group with 2 updates

Bumps the npm group with 2 updates: [eslint](https://github.com/eslint/eslint) and [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import).


Updates `eslint` from 8.45.0 to 8.46.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.45.0...v8.46.0)

Updates `eslint-plugin-import` from 2.27.5 to 2.28.0
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.27.5...v2.28.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2023-08-01 03:35:02 -07:00 committed by GitHub
parent a6b0ced86b
commit e7e35baaf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1408 changed files with 27215 additions and 9910 deletions

View file

@ -4,7 +4,7 @@ var ToNumber = require('./ToNumber');
var ToPrimitive = require('./ToPrimitive');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison
// https://262.ecma-international.org/6.0/#sec-abstract-equality-comparison
module.exports = function AbstractEqualityComparison(x, y) {
var xType = Type(x);

View file

@ -2,24 +2,24 @@
var GetIntrinsic = require('get-intrinsic');
var IsInteger = require('./IsInteger');
var Type = require('./Type');
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
var isInteger = require('../helpers/isInteger');
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate');
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate');
var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
var $TypeError = GetIntrinsic('%TypeError%');
var $charCodeAt = require('call-bind/callBound')('String.prototype.charCodeAt');
// https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex
// https://262.ecma-international.org/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) {
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') {

View file

@ -7,7 +7,7 @@ var $RangeError = GetIntrinsic('%RangeError%');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $TypeError = GetIntrinsic('%TypeError%');
var IsInteger = require('./IsInteger');
var isInteger = require('../helpers/isInteger');
var hasProto = require('has-proto')();
@ -22,10 +22,10 @@ var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || (
: null
);
// https://ecma-international.org/ecma-262/6.0/#sec-arraycreate
// https://262.ecma-international.org/6.0/#sec-arraycreate
module.exports = function ArrayCreate(length) {
if (!IsInteger(length) || length < 0) {
if (!isInteger(length) || length < 0) {
throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0');
}
if (length > MAX_ARRAY_LENGTH) {

View file

@ -19,7 +19,7 @@ var ToString = require('./ToString');
var ToUint32 = require('./ToUint32');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-arraysetlength
// https://262.ecma-international.org/6.0/#sec-arraysetlength
// eslint-disable-next-line max-statements, max-lines-per-function
module.exports = function ArraySetLength(A, Desc) {

View file

@ -9,13 +9,14 @@ 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
var isInteger = require('../helpers/isInteger');
// https://262.ecma-international.org/6.0/#sec-arrayspeciescreate
module.exports = function ArraySpeciesCreate(originalArray, length) {
if (!IsInteger(length) || length < 0) {
if (!isInteger(length) || length < 0) {
throw new $TypeError('Assertion failed: length must be an integer >= 0');
}
var len = length === 0 ? 0 : length;

View file

@ -7,9 +7,9 @@ var $TypeError = GetIntrinsic('%TypeError%');
var IsArray = require('./IsArray');
var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%');
var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');
// https://ecma-international.org/ecma-262/6.0/#sec-call
// https://262.ecma-international.org/6.0/#sec-call
module.exports = function Call(F, V) {
var argumentsList = arguments.length > 2 ? arguments[2] : [];

View file

@ -9,7 +9,7 @@ var ToNumber = require('./ToNumber');
var ToString = require('./ToString');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring
// https://262.ecma-international.org/6.0/#sec-canonicalnumericindexstring
module.exports = function CanonicalNumericIndexString(argument) {
if (Type(argument) !== 'String') {

55
node_modules/es-abstract/2017/Canonicalize.js generated vendored Normal file
View file

@ -0,0 +1,55 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var callBound = require('call-bind/callBound');
var has = require('has');
var $charCodeAt = callBound('String.prototype.charCodeAt');
var $toUpperCase = callBound('String.prototype.toUpperCase');
var Type = require('./Type');
var caseFolding = require('../helpers/caseFolding');
// https://262.ecma-international.org/6.0/#sec-runtime-semantics-canonicalize-ch
module.exports = function Canonicalize(ch, IgnoreCase, Unicode) {
if (Type(ch) !== 'String') {
throw new $TypeError('Assertion failed: `ch` must be a character');
}
if (Type(IgnoreCase) !== 'Boolean' || Type(Unicode) !== 'Boolean') {
throw new $TypeError('Assertion failed: `IgnoreCase` and `Unicode` must be Booleans');
}
if (!IgnoreCase) {
return ch; // step 1
}
if (Unicode) { // step 2
if (has(caseFolding.C, ch)) {
return caseFolding.C[ch];
}
if (has(caseFolding.S, ch)) {
return caseFolding.S[ch];
}
return ch; // step 2.b
}
var u = $toUpperCase(ch); // step 2
if (u.length !== 1) {
return ch; // step 3
}
var cu = u; // step 4
if ($charCodeAt(ch, 0) >= 128 && $charCodeAt(cu, 0) < 128) {
return ch; // step 5
}
return cu;
};

View file

@ -5,8 +5,8 @@ var callBound = require('call-bind/callBound');
var $fromCharCode = GetIntrinsic('%String.fromCharCode%');
var $TypeError = GetIntrinsic('%TypeError%');
var $charCodeAt = callBound('%String.prototype.charCodeAt%');
var $push = callBound('%Array.prototype.push%');
var $charCodeAt = callBound('String.prototype.charCodeAt');
var $push = callBound('Array.prototype.push');
module.exports = function CharacterRange(A, B) {
if (A.length !== 1 || B.length !== 1) {

View file

@ -8,7 +8,7 @@ var IsDataDescriptor = require('./IsDataDescriptor');
var IsGenericDescriptor = require('./IsGenericDescriptor');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor
// https://262.ecma-international.org/6.0/#sec-completepropertydescriptor
module.exports = function CompletePropertyDescriptor(Desc) {
/* eslint no-param-reassign: 0 */

View file

@ -4,17 +4,11 @@ var GetIntrinsic = require('get-intrinsic');
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 OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty
// https://262.ecma-international.org/6.0/#sec-createdataproperty
module.exports = function CreateDataProperty(O, P, V) {
if (Type(O) !== 'Object') {
@ -23,23 +17,11 @@ module.exports = function CreateDataProperty(O, P, V) {
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
var oldDesc = OrdinaryGetOwnProperty(O, P);
var extensible = !oldDesc || IsExtensible(O);
var nonConfigurable = oldDesc && !oldDesc['[[Configurable]]'];
if (nonConfigurable || !extensible) {
return false;
}
return DefineOwnProperty(
IsDataDescriptor,
SameValue,
FromPropertyDescriptor,
O,
P,
{
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Value]]': V,
'[[Writable]]': true
}
);
var newDesc = {
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Value]]': V,
'[[Writable]]': true
};
return OrdinaryDefineOwnProperty(O, P, newDesc);
};

View file

@ -8,7 +8,7 @@ var CreateDataProperty = require('./CreateDataProperty');
var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');
// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow
// // https://262.ecma-international.org/6.0/#sec-createdatapropertyorthrow
module.exports = function CreateDataPropertyOrThrow(O, P, V) {
if (Type(O) !== 'Object') {

View file

@ -12,7 +12,7 @@ var RequireObjectCoercible = require('./RequireObjectCoercible');
var ToString = require('./ToString');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-createhtml
// https://262.ecma-international.org/6.0/#sec-createhtml
module.exports = function CreateHTML(string, tag, attribute, value) {
if (Type(tag) !== 'String' || Type(attribute) !== 'String') {

View file

@ -6,7 +6,7 @@ var $TypeError = GetIntrinsic('%TypeError%');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject
// https://262.ecma-international.org/6.0/#sec-createiterresultobject
module.exports = function CreateIterResultObject(value, done) {
if (Type(done) !== 'Boolean') {

View file

@ -14,11 +14,13 @@ var ToLength = require('./ToLength');
var ToString = require('./ToString');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike
var defaultElementTypes = ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object'];
// https://262.ecma-international.org/6.0/#sec-createlistfromarraylike
module.exports = function CreateListFromArrayLike(obj) {
var elementTypes = arguments.length > 1
? arguments[1]
: ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object'];
: defaultElementTypes;
if (Type(obj) !== 'Object') {
throw new $TypeError('Assertion failed: `obj` must be an Object');

View file

@ -12,7 +12,7 @@ var IsPropertyKey = require('./IsPropertyKey');
var SameValue = require('./SameValue');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-createmethodproperty
// https://262.ecma-international.org/6.0/#sec-createmethodproperty
module.exports = function CreateMethodProperty(O, P, V) {
if (Type(O) !== 'Object') {

View file

@ -15,7 +15,7 @@ var SameValue = require('./SameValue');
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow
// https://262.ecma-international.org/6.0/#sec-definepropertyorthrow
module.exports = function DefinePropertyOrThrow(O, P, desc) {
if (Type(O) !== 'Object') {

View file

@ -7,7 +7,7 @@ var $TypeError = GetIntrinsic('%TypeError%');
var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow
// https://262.ecma-international.org/6.0/#sec-deletepropertyorthrow
module.exports = function DeletePropertyOrThrow(O, P) {
if (Type(O) !== 'Object') {

View file

@ -5,7 +5,7 @@ var fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor
module.exports = function FromPropertyDescriptor(Desc) {
if (typeof Desc !== 'undefined') {

View file

@ -9,7 +9,7 @@ var inspect = require('object-inspect');
var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
// https://262.ecma-international.org/6.0/#sec-get-o-p
module.exports = function Get(O, P) {
// 7.3.1.1

View file

@ -11,7 +11,7 @@ var GetMethod = require('./GetMethod');
var IsArray = require('./IsArray');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-getiterator
// https://262.ecma-international.org/6.0/#sec-getiterator
module.exports = function GetIterator(obj, method) {
var actualMethod = method;

View file

@ -8,9 +8,9 @@ var GetV = require('./GetV');
var IsCallable = require('./IsCallable');
var IsPropertyKey = require('./IsPropertyKey');
var debug = require('object-inspect');
var inspect = require('object-inspect');
// https://ecma-international.org/ecma-262/6.0/#sec-getmethod
// https://262.ecma-international.org/6.0/#sec-getmethod
module.exports = function GetMethod(O, P) {
// 7.3.9.1
@ -28,7 +28,7 @@ module.exports = function GetMethod(O, P) {
// 7.3.9.5
if (!IsCallable(func)) {
throw new $TypeError(P + ' is not a function: ' + debug(func));
throw new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));
}
// 7.3.9.6

View file

@ -12,7 +12,7 @@ var keys = require('object-keys');
var esType = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys
// https://262.ecma-international.org/6.0/#sec-getownpropertykeys
module.exports = function GetOwnPropertyKeys(O, Type) {
if (esType(O) !== 'Object') {

View file

@ -10,10 +10,13 @@ var Get = require('./Get');
var IsConstructor = require('./IsConstructor');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor
// https://262.ecma-international.org/6.0/#sec-getprototypefromconstructor
module.exports = function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) {
var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic
if (Type(intrinsic) !== 'Object') {
throw new $TypeError('intrinsicDefaultProto must be an object');
}
if (!IsConstructor(constructor)) {
throw new $TypeError('Assertion failed: `constructor` must be a constructor');
}

View file

@ -18,18 +18,14 @@ 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 isInteger = require('../helpers/isInteger');
var isStringOrHole = require('../helpers/isStringOrHole');
var isStringOrHole = function (capture, index, arr) {
return Type(capture) === 'String' || (canDistinguishSparseFromUndefined ? !(index in arr) : Type(capture) === 'Undefined');
};
// https://262.ecma-international.org/6.0/#sec-getsubstitution
// https://ecma-international.org/ecma-262/6.0/#sec-getsubstitution
// eslint-disable-next-line max-statements, max-params, max-lines-per-function
// eslint-disable-next-line max-statements, 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');
@ -41,7 +37,7 @@ module.exports = function GetSubstitution(matched, str, position, captures, repl
}
var stringLength = str.length;
if (!IsInteger(position) || position < 0 || position > stringLength) {
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));
}

View file

@ -4,20 +4,22 @@ var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var IsPropertyKey = require('./IsPropertyKey');
var ToObject = require('./ToObject');
var inspect = require('object-inspect');
// https://ecma-international.org/ecma-262/6.0/#sec-getv
var IsPropertyKey = require('./IsPropertyKey');
// var ToObject = require('./ToObject');
// https://262.ecma-international.org/6.0/#sec-getv
module.exports = function GetV(V, P) {
// 7.3.2.1
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));
}
// 7.3.2.2-3
var O = ToObject(V);
// var O = ToObject(V);
// 7.3.2.4
return O[P];
return V[P];
};

108
node_modules/es-abstract/2017/GetValueFromBuffer.js generated vendored Normal file
View file

@ -0,0 +1,108 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $TypeError = GetIntrinsic('%TypeError%');
var $Uint8Array = GetIntrinsic('%Uint8Array%', true);
var callBound = require('call-bind/callBound');
var $slice = callBound('Array.prototype.slice');
var isInteger = require('../helpers/isInteger');
var IsDetachedBuffer = require('./IsDetachedBuffer');
var RawBytesToNumber = require('./RawBytesToNumber');
var isArrayBuffer = require('is-array-buffer');
var isSharedArrayBuffer = require('is-shared-array-buffer');
var safeConcat = require('safe-array-concat');
var table50 = {
__proto__: null,
$Int8: 1,
$Uint8: 1,
$Uint8C: 1,
$Int16: 2,
$Uint16: 2,
$Int32: 4,
$Uint32: 4,
$Float32: 4,
$Float64: 8
};
var defaultEndianness = require('../helpers/defaultEndianness');
// https://262.ecma-international.org/8.0/#sec-getvaluefrombuffer
module.exports = function GetValueFromBuffer(arrayBuffer, byteIndex, type, isTypedArray, order) {
var isSAB = isSharedArrayBuffer(arrayBuffer);
if (!isArrayBuffer(arrayBuffer) && !isSAB) {
throw new $TypeError('Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer');
}
if (!isInteger(byteIndex)) {
throw new $TypeError('Assertion failed: `byteIndex` must be an integer');
}
if (typeof type !== 'string') {
throw new $TypeError('Assertion failed: `type` must be a string');
}
if (typeof isTypedArray !== 'boolean') {
throw new $TypeError('Assertion failed: `isTypedArray` must be a boolean');
}
if (typeof order !== 'string') {
throw new $TypeError('Assertion failed: `order` must be a string');
}
if (arguments.length > 5 && typeof arguments[5] !== 'boolean') {
throw new $TypeError('Assertion failed: `isLittleEndian` must be a boolean, if present');
}
if (IsDetachedBuffer(arrayBuffer)) {
throw new $TypeError('Assertion failed: `arrayBuffer` is detached'); // step 1
}
// 2. Assert: There are sufficient bytes in arrayBuffer starting at byteIndex to represent a value of type.
if (byteIndex < 0) {
throw new $TypeError('Assertion failed: `byteIndex` must be non-negative'); // step 3
}
// 4. Let block be arrayBuffer.[[ArrayBufferData]].
var elementSize = table50['$' + type]; // step 5
if (!elementSize) {
throw new $TypeError('Assertion failed: `type` must be one of "Int8", "Uint8", "Uint8C", "Int16", "Uint16", "Int32", "Uint32", "Float32", or "Float64"');
}
var rawValue;
if (isSAB) { // step 6
/*
a. Let execution be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
b. Let eventList be the [[EventList]] field of the element in execution.[[EventLists]] whose [[AgentSignifier]] is AgentSignifier().
c. If isTypedArray is true and type is "Int8", "Uint8", "Int16", "Uint16", "Int32", or "Uint32", let noTear be true; otherwise let noTear be false.
d. Let rawValue be a List of length elementSize of nondeterministically chosen byte values.
e. NOTE: In implementations, rawValue is the result of a non-atomic or atomic read instruction on the underlying hardware. The nondeterminism is a semantic prescription of the memory model to describe observable behaviour of hardware with weak consistency.
f. Let readEvent be ReadSharedMemory{ [[Order]]: order, [[NoTear]]: noTear, [[Block]]: block, [[ByteIndex]]: byteIndex, [[ElementSize]]: elementSize }.
g. Append readEvent to eventList.
h. Append Chosen Value Record { [[Event]]: readEvent, [[ChosenValue]]: rawValue } to execution.[[ChosenValues]].
*/
throw new $SyntaxError('TODO: support SharedArrayBuffers');
} else {
// 7. Let rawValue be a List of elementSize containing, in order, the elementSize sequence of bytes starting with block[byteIndex].
rawValue = $slice(new $Uint8Array(arrayBuffer, byteIndex), 0, elementSize); // step 6
}
// 8. If isLittleEndian is not present, set isLittleEndian to either true or false. The choice is implementation dependent and should be the alternative that is most efficient for the implementation. An implementation must use the same value each time this step is executed and the same value must be used for the corresponding step in the SetValueInBuffer abstract operation.
var isLittleEndian = arguments.length > 5 ? arguments[5] : defaultEndianness === 'little'; // step 8
var bytes = isLittleEndian
? $slice(safeConcat([0, 0, 0, 0, 0, 0, 0, 0], rawValue), -elementSize)
: $slice(safeConcat(rawValue, [0, 0, 0, 0, 0, 0, 0, 0]), 0, elementSize);
return RawBytesToNumber(type, bytes, isLittleEndian);
};

View file

@ -9,7 +9,7 @@ var has = require('has');
var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty
// https://262.ecma-international.org/6.0/#sec-hasownproperty
module.exports = function HasOwnProperty(O, P) {
if (Type(O) !== 'Object') {

View file

@ -7,7 +7,7 @@ var $TypeError = GetIntrinsic('%TypeError%');
var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
// https://262.ecma-international.org/6.0/#sec-hasproperty
module.exports = function HasProperty(O, P) {
if (Type(O) !== 'Object') {

View file

@ -13,7 +13,7 @@ var OrdinaryHasInstance = require('./OrdinaryHasInstance');
var ToBoolean = require('./ToBoolean');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-instanceofoperator
// https://262.ecma-international.org/6.0/#sec-instanceofoperator
module.exports = function InstanceofOperator(O, C) {
if (Type(O) !== 'Object') {

View file

@ -9,7 +9,7 @@ var IsArray = require('./IsArray');
var GetV = require('./GetV');
var IsPropertyKey = require('./IsPropertyKey');
// https://ecma-international.org/ecma-262/6.0/#sec-invoke
// https://262.ecma-international.org/6.0/#sec-invoke
module.exports = function Invoke(O, P) {
if (!IsPropertyKey(P)) {

View file

@ -2,11 +2,11 @@
var has = require('has');
var assertRecord = require('../helpers/assertRecord');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor
var assertRecord = require('../helpers/assertRecord');
// https://262.ecma-international.org/5.1/#sec-8.10.1
module.exports = function IsAccessorDescriptor(Desc) {
if (typeof Desc === 'undefined') {

View file

@ -1,4 +1,4 @@
'use strict';
// https://ecma-international.org/ecma-262/6.0/#sec-isarray
// https://262.ecma-international.org/6.0/#sec-isarray
module.exports = require('../helpers/IsArray');

View file

@ -9,7 +9,7 @@ var IsArray = require('./IsArray');
var ToBoolean = require('./ToBoolean');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable
// https://262.ecma-international.org/6.0/#sec-isconcatspreadable
module.exports = function IsConcatSpreadable(O) {
if (Type(O) !== 'Object') {

View file

@ -12,7 +12,7 @@ try {
DefinePropertyOrThrow = null;
}
// https://ecma-international.org/ecma-262/6.0/#sec-isconstructor
// https://262.ecma-international.org/6.0/#sec-isconstructor
if (DefinePropertyOrThrow && $construct) {
var isConstructorMarker = {};

View file

@ -2,11 +2,11 @@
var has = require('has');
var assertRecord = require('../helpers/assertRecord');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
var assertRecord = require('../helpers/assertRecord');
// https://262.ecma-international.org/5.1/#sec-8.10.2
module.exports = function IsDataDescriptor(Desc) {
if (typeof Desc === 'undefined') {

View file

@ -4,10 +4,7 @@ var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var callBound = require('call-bind/callBound');
var $byteLength = callBound('%ArrayBuffer.prototype.byteLength%', true)
|| function byteLength(ab) { return ab.byteLength; }; // in node < 0.11, byteLength is an own nonconfigurable property
var $byteLength = require('array-buffer-byte-length');
var isArrayBuffer = require('is-array-buffer');
@ -23,7 +20,7 @@ module.exports = function IsDetachedBuffer(arrayBuffer) {
try {
new global[availableTypedArrays[0]](arrayBuffer); // eslint-disable-line no-new
} catch (error) {
return error.name === 'TypeError';
return !!error && error.name === 'TypeError';
}
}
return false;

View file

@ -7,7 +7,7 @@ var $isExtensible = GetIntrinsic('%Object.isExtensible%', true);
var isPrimitive = require('../helpers/isPrimitive');
// https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o
// https://262.ecma-international.org/6.0/#sec-isextensible-o
module.exports = $preventExtensions
? function IsExtensible(obj) {

View file

@ -6,7 +6,7 @@ var IsAccessorDescriptor = require('./IsAccessorDescriptor');
var IsDataDescriptor = require('./IsDataDescriptor');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor
// https://262.ecma-international.org/6.0/#sec-isgenericdescriptor
module.exports = function IsGenericDescriptor(Desc) {
if (typeof Desc === 'undefined') {

View file

@ -1,17 +1,9 @@
'use strict';
var abs = require('./abs');
var floor = require('./floor');
var isInteger = require('../helpers/isInteger');
var $isNaN = require('../helpers/isNaN');
var $isFinite = require('../helpers/isFinite');
// https://ecma-international.org/ecma-262/6.0/#sec-isinteger
// https://262.ecma-international.org/6.0/#sec-isinteger
module.exports = function IsInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var absValue = abs(argument);
return floor(absValue) === absValue;
return isInteger(argument);
};

View file

@ -6,7 +6,7 @@ var $PromiseThen = callBound('Promise.prototype.then', true);
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-ispromise
// https://262.ecma-international.org/6.0/#sec-ispromise
module.exports = function IsPromise(x) {
if (Type(x) !== 'Object') {

View file

@ -1,6 +1,6 @@
'use strict';
// https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey
// https://262.ecma-international.org/6.0/#sec-ispropertykey
module.exports = function IsPropertyKey(argument) {
return typeof argument === 'string' || typeof argument === 'symbol';

View file

@ -8,7 +8,7 @@ var hasRegExpMatcher = require('is-regex');
var ToBoolean = require('./ToBoolean');
// https://ecma-international.org/ecma-262/6.0/#sec-isregexp
// https://262.ecma-international.org/6.0/#sec-isregexp
module.exports = function IsRegExp(argument) {
if (!argument || typeof argument !== 'object') {

48
node_modules/es-abstract/2017/IsWordChar.js generated vendored Normal file
View file

@ -0,0 +1,48 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var callBound = require('call-bind/callBound');
var $indexOf = callBound('String.prototype.indexOf');
var IsArray = require('./IsArray');
var IsInteger = require('./IsInteger');
var Type = require('./Type');
var WordCharacters = require('./WordCharacters');
var every = require('../helpers/every');
var isChar = function isChar(c) {
return typeof c === 'string';
};
// https://262.ecma-international.org/8.0/#sec-runtime-semantics-iswordchar-abstract-operation
// note: prior to ES2023, this AO erroneously omitted the latter of its arguments.
module.exports = function IsWordChar(e, InputLength, Input, IgnoreCase, Unicode) {
if (!IsInteger(e)) {
throw new $TypeError('Assertion failed: `e` must be an integer');
}
if (!IsInteger(InputLength)) {
throw new $TypeError('Assertion failed: `InputLength` must be an integer');
}
if (!IsArray(Input) || !every(Input, isChar)) {
throw new $TypeError('Assertion failed: `Input` must be a List of characters');
}
if (Type(IgnoreCase) !== 'Boolean' || Type(Unicode) !== 'Boolean') {
throw new $TypeError('Assertion failed: `IgnoreCase` and `Unicode` must be booleans');
}
if (e === -1 || e === InputLength) {
return false; // step 1
}
var c = Input[e]; // step 2
var wordChars = WordCharacters(IgnoreCase, Unicode);
return $indexOf(wordChars, c) > -1; // steps 3-4
};

View file

@ -10,7 +10,7 @@ var GetMethod = require('./GetMethod');
var IsCallable = require('./IsCallable');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose
// https://262.ecma-international.org/6.0/#sec-iteratorclose
module.exports = function IteratorClose(iterator, completion) {
if (Type(iterator) !== 'Object') {

View file

@ -8,7 +8,7 @@ var Get = require('./Get');
var ToBoolean = require('./ToBoolean');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete
// https://262.ecma-international.org/6.0/#sec-iteratorcomplete
module.exports = function IteratorComplete(iterResult) {
if (Type(iterResult) !== 'Object') {

View file

@ -7,7 +7,7 @@ var $TypeError = GetIntrinsic('%TypeError%');
var Invoke = require('./Invoke');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext
// https://262.ecma-international.org/6.0/#sec-iteratornext
module.exports = function IteratorNext(iterator, value) {
var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]);

View file

@ -3,7 +3,7 @@
var IteratorComplete = require('./IteratorComplete');
var IteratorNext = require('./IteratorNext');
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep
// https://262.ecma-international.org/6.0/#sec-iteratorstep
module.exports = function IteratorStep(iterator) {
var result = IteratorNext(iterator);

View file

@ -7,7 +7,7 @@ var $TypeError = GetIntrinsic('%TypeError%');
var Get = require('./Get');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue
// https://262.ecma-international.org/6.0/#sec-iteratorvalue
module.exports = function IteratorValue(iterResult) {
if (Type(iterResult) !== 'Object') {

36
node_modules/es-abstract/2017/NewPromiseCapability.js generated vendored Normal file
View file

@ -0,0 +1,36 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var IsCallable = require('es-abstract/2022/IsCallable');
var IsConstructor = require('es-abstract/2022/IsConstructor');
// https://262.ecma-international.org/6.0/#sec-newpromisecapability
module.exports = function NewPromiseCapability(C) {
if (!IsConstructor(C)) {
throw new $TypeError('C must be a constructor'); // step 1
}
var resolvingFunctions = { '[[Resolve]]': void undefined, '[[Reject]]': void undefined }; // step 3
var promise = new C(function (resolve, reject) { // steps 4-5
if (typeof resolvingFunctions['[[Resolve]]'] !== 'undefined' || typeof resolvingFunctions['[[Reject]]'] !== 'undefined') {
throw new $TypeError('executor has already been called'); // step 4.a, 4.b
}
resolvingFunctions['[[Resolve]]'] = resolve; // step 4.c
resolvingFunctions['[[Reject]]'] = reject; // step 4.d
}); // step 4-6
if (!IsCallable(resolvingFunctions['[[Resolve]]']) || !IsCallable(resolvingFunctions['[[Reject]]'])) {
throw new $TypeError('executor must provide valid resolve and reject functions'); // steps 7-8
}
return {
'[[Promise]]': promise,
'[[Resolve]]': resolvingFunctions['[[Resolve]]'],
'[[Reject]]': resolvingFunctions['[[Reject]]']
}; // step 9
};

View file

@ -2,23 +2,8 @@
var GetIntrinsic = require('get-intrinsic');
var $floor = GetIntrinsic('%Math.floor%');
var $log = GetIntrinsic('%Math.log%');
var $log2E = GetIntrinsic('%Math.LOG2E%');
var $log2 = GetIntrinsic('%Math.log2%', true) || function log2(x) {
return $log(x) * $log2E;
};
var $parseInt = GetIntrinsic('%parseInt%');
var $pow = GetIntrinsic('%Math.pow%');
var $TypeError = GetIntrinsic('%TypeError%');
var callBound = require('call-bind/callBound');
var $reverse = callBound('Array.prototype.reverse');
var $numberToString = callBound('Number.prototype.toString');
var $strSlice = callBound('String.prototype.slice');
var abs = require('./abs');
var hasOwnProperty = require('./HasOwnProperty');
var ToInt16 = require('./ToInt16');
var ToInt32 = require('./ToInt32');
@ -29,8 +14,9 @@ var ToUint8 = require('./ToUint8');
var ToUint8Clamp = require('./ToUint8Clamp');
var Type = require('./Type');
var isNaN = require('../helpers/isNaN');
var isFinite = require('../helpers/isFinite');
var valueToFloat32Bytes = require('../helpers/valueToFloat32Bytes');
var valueToFloat64Bytes = require('../helpers/valueToFloat64Bytes');
var integerToNBytes = require('../helpers/integerToNBytes');
var keys = require('object-keys');
@ -72,105 +58,10 @@ module.exports = function NumberToRawBytes(type, value, isLittleEndian) {
throw new $TypeError('Assertion failed: `isLittleEndian` must be a Boolean');
}
var rawBytes = [];
var exponent;
if (type === 'Float32') { // step 1
if (isNaN(value)) {
return isLittleEndian ? [0, 0, 192, 127] : [127, 192, 0, 0]; // hardcoded
}
var leastSig;
if (value === 0) {
leastSig = Object.is(value, -0) ? 0x80 : 0;
return isLittleEndian ? [0, 0, 0, leastSig] : [leastSig, 0, 0, 0];
}
if (!isFinite(value)) {
leastSig = value < 0 ? 255 : 127;
return isLittleEndian ? [0, 0, 128, leastSig] : [leastSig, 128, 0, 0];
}
var sign = value < 0 ? 1 : 0;
value = abs(value); // eslint-disable-line no-param-reassign
exponent = 0;
while (value >= 2) {
exponent += 1;
value /= 2; // eslint-disable-line no-param-reassign
}
while (value < 1) {
exponent -= 1;
value *= 2; // eslint-disable-line no-param-reassign
}
var mantissa = value - 1;
mantissa *= $pow(2, 23);
mantissa = $floor(mantissa);
exponent += 127;
exponent = exponent << 23;
var result = sign << 31;
result |= exponent;
result |= mantissa;
var byte0 = result & 255;
result = result >> 8;
var byte1 = result & 255;
result = result >> 8;
var byte2 = result & 255;
result = result >> 8;
var byte3 = result & 255;
if (isLittleEndian) {
return [byte0, byte1, byte2, byte3];
}
return [byte3, byte2, byte1, byte0];
return valueToFloat32Bytes(value, isLittleEndian);
} else if (type === 'Float64') { // step 2
if (value === 0) {
leastSig = Object.is(value, -0) ? 0x80 : 0;
return isLittleEndian ? [0, 0, 0, 0, 0, 0, 0, leastSig] : [leastSig, 0, 0, 0, 0, 0, 0, 0];
}
if (isNaN(value)) {
return isLittleEndian ? [0, 0, 0, 0, 0, 0, 248, 127] : [127, 248, 0, 0, 0, 0, 0, 0];
}
if (!isFinite(value)) {
var infBytes = value < 0 ? [0, 0, 0, 0, 0, 0, 240, 255] : [0, 0, 0, 0, 0, 0, 240, 127];
return isLittleEndian ? infBytes : $reverse(infBytes);
}
var isNegative = value < 0;
if (isNegative) { value = -value; } // eslint-disable-line no-param-reassign
exponent = $floor($log2(value));
var significand = (value / $pow(2, exponent)) - 1;
var bitString = '';
for (var i = 0; i < 52; i++) {
significand *= 2;
if (significand >= 1) {
bitString += '1';
significand -= 1;
} else {
bitString += '0';
}
}
exponent += 1023;
var exponentBits = $numberToString(exponent, 2);
while (exponentBits.length < 11) { exponentBits = '0' + exponentBits; }
var fullBitString = (isNegative ? '1' : '0') + exponentBits + bitString;
while (fullBitString.length < 64) { fullBitString = '0' + fullBitString; }
for (i = 0; i < 8; i++) {
rawBytes[i] = $parseInt($strSlice(fullBitString, i * 8, (i + 1) * 8), 2);
}
return isLittleEndian ? $reverse(rawBytes) : rawBytes;
return valueToFloat64Bytes(value, isLittleEndian);
} // step 3
var n = TypeToSizes[type]; // step 3.a
@ -179,20 +70,5 @@ module.exports = function NumberToRawBytes(type, value, isLittleEndian) {
var intValue = convOp(value); // step 3.c
/*
if (intValue >= 0) { // step 3.d
// Let rawBytes be a List containing the n-byte binary encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.
} else { // step 3.e
// Let rawBytes be a List containing the n-byte binary 2's complement encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.
}
*/
if (intValue < 0) {
intValue = intValue >>> 0;
}
for (i = 0; i < n; i++) {
rawBytes[isLittleEndian ? i : n - 1 - i] = intValue & 0xff;
intValue = intValue >> 8;
}
return rawBytes; // step 4
return integerToNBytes(intValue, n, isLittleEndian); // step 3.d, 3.e, 4
};

View file

@ -15,7 +15,7 @@ var SLOT = require('internal-slot');
var hasProto = require('has-proto')();
// https://ecma-international.org/ecma-262/6.0/#sec-objectcreate
// https://262.ecma-international.org/6.0/#sec-objectcreate
module.exports = function ObjectCreate(proto, internalSlotsList) {
if (proto !== null && Type(proto) !== 'Object') {

View file

@ -3,7 +3,6 @@
var callBound = require('call-bind/callBound');
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
var FromPropertyDescriptor = require('./FromPropertyDescriptor');
var Get = require('./Get');
var ToObject = require('./ToObject');
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
@ -32,7 +31,6 @@ module.exports = function ObjectDefineProperties(O, Properties) {
forEach(descriptors, function (pair) { // step 5
var P = pair[0]; // step 5.a
var desc = pair[1]; // step 5.b
desc = FromPropertyDescriptor(desc); // TODO: remove this once DefinePropertyOrThrow is fixed
DefinePropertyOrThrow(O, P, desc); // step 5.c
});

View file

@ -7,7 +7,7 @@ var GetPrototypeFromConstructor = require('./GetPrototypeFromConstructor');
var IsArray = require('./IsArray');
var ObjectCreate = require('./ObjectCreate');
// https://ecma-international.org/ecma-262/6.0/#sec-ordinarycreatefromconstructor
// https://262.ecma-international.org/6.0/#sec-ordinarycreatefromconstructor
module.exports = function OrdinaryCreateFromConstructor(constructor, intrinsicDefaultProto) {
GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic

View file

@ -17,7 +17,7 @@ var SameValue = require('./SameValue');
var Type = require('./Type');
var ValidateAndApplyPropertyDescriptor = require('./ValidateAndApplyPropertyDescriptor');
// https://ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty
// https://262.ecma-international.org/6.0/#sec-ordinarydefineownproperty
module.exports = function OrdinaryDefineOwnProperty(O, P, Desc) {
if (Type(O) !== 'Object') {

View file

@ -17,7 +17,7 @@ var IsRegExp = require('./IsRegExp');
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
// https://262.ecma-international.org/6.0/#sec-ordinarygetownproperty
module.exports = function OrdinaryGetOwnProperty(O, P) {
if (Type(O) !== 'Object') {

View file

@ -8,10 +8,10 @@ var Get = require('./Get');
var IsCallable = require('./IsCallable');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance
// https://262.ecma-international.org/6.0/#sec-ordinaryhasinstance
module.exports = function OrdinaryHasInstance(C, O) {
if (IsCallable(C) === false) {
if (!IsCallable(C)) {
return false;
}
if (Type(O) !== 'Object') {

View file

@ -7,7 +7,7 @@ var $TypeError = GetIntrinsic('%TypeError%');
var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty
// https://262.ecma-international.org/6.0/#sec-ordinaryhasproperty
module.exports = function OrdinaryHasProperty(O, P) {
if (Type(O) !== 'Object') {

View file

@ -15,7 +15,7 @@ var $strSplit = callBound('String.prototype.split');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-quotejsonstring
// https://262.ecma-international.org/6.0/#sec-quotejsonstring
var escapes = {
'\u0008': 'b',

View file

@ -3,7 +3,6 @@
var GetIntrinsic = require('get-intrinsic');
var callBound = require('call-bind/callBound');
var $pow = GetIntrinsic('%Math.pow%');
var $RangeError = GetIntrinsic('%RangeError%');
var $TypeError = GetIntrinsic('%TypeError%');
@ -15,6 +14,9 @@ var hasOwnProperty = require('./HasOwnProperty');
var IsArray = require('./IsArray');
var Type = require('./Type');
var bytesAsFloat32 = require('../helpers/bytesAsFloat32');
var bytesAsFloat64 = require('../helpers/bytesAsFloat64');
var bytesAsInteger = require('../helpers/bytesAsInteger');
var every = require('../helpers/every');
var isByteValue = require('../helpers/isByteValue');
@ -57,89 +59,16 @@ module.exports = function RawBytesToNumber(type, rawBytes, isLittleEndian) {
// eslint-disable-next-line no-param-reassign
rawBytes = $slice(rawBytes, 0, elementSize);
if (!isLittleEndian) {
// eslint-disable-next-line no-param-reassign
rawBytes = $reverse(rawBytes); // step 2
$reverse(rawBytes); // step 2
}
/* eslint no-redeclare: 1 */
if (type === 'Float32') { // step 3
/*
Let value be the byte elements of rawBytes concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2008 binary32 value.
If value is an IEEE 754-2008 binary32 NaN value, return the NaN Number value.
Return the Number value that corresponds to value.
*/
var sign = (rawBytes[3] & 0x80) >> 7; // first bit
var exponent = ((rawBytes[3] & 0x7F) << 1) // 7 bits from index 3
| ((rawBytes[2] & 0x80) >> 7); // 1 bit from index 2
var mantissa = ((rawBytes[2] & 0x7F) << 16) // 7 bits from index 2
| (rawBytes[1] << 8) // 8 bits from index 1
| rawBytes[0]; // 8 bits from index 0
if (exponent === 0 && mantissa === 0) {
return sign === 0 ? 0 : -0;
}
if (exponent === 0xFF && mantissa === 0) {
return sign === 0 ? Infinity : -Infinity;
}
if (exponent === 0xFF && mantissa !== 0) {
return NaN;
}
exponent -= 127; // subtract the bias
// return $pow(-1, sign) * mantissa / $pow(2, 23) * $pow(2, exponent);
// return $pow(-1, sign) * (mantissa + 0x1000000) * $pow(2, exponent - 23);
return $pow(-1, sign) * (1 + (mantissa / $pow(2, 23))) * $pow(2, exponent);
return bytesAsFloat32(rawBytes);
}
if (type === 'Float64') { // step 4
/*
Let value be the byte elements of rawBytes concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2008 binary64 value.
If value is an IEEE 754-2008 binary64 NaN value, return the NaN Number value.
Return the Number value that corresponds to value.
*/
var sign = rawBytes[7] & 0x80 ? -1 : 1; // first bit
var exponent = ((rawBytes[7] & 0x7F) << 4) // 7 bits from index 7
| ((rawBytes[6] & 0xF0) >> 4); // 4 bits from index 6
var mantissa = ((rawBytes[6] & 0x0F) * 0x1000000000000) // 4 bits from index 6
+ (rawBytes[5] * 0x10000000000) // 8 bits from index 5
+ (rawBytes[4] * 0x100000000) // 8 bits from index 4
+ (rawBytes[3] * 0x1000000) // 8 bits from index 3
+ (rawBytes[2] * 0x10000) // 8 bits from index 2
+ (rawBytes[1] * 0x100) // 8 bits from index 1
+ rawBytes[0]; // 8 bits from index 0
if (exponent === 0 && mantissa === 0) {
return sign * 0;
}
if (exponent === 0x7FF && mantissa !== 0) {
return NaN;
}
if (exponent === 0x7FF && mantissa === 0) {
return sign * Infinity;
}
exponent -= 1023; // subtract the bias
return sign * (mantissa + 0x10000000000000) * $pow(2, exponent - 52);
return bytesAsFloat64(rawBytes);
}
// this is common to both branches
var intValue = 0;
for (var i = 0; i < rawBytes.length; i++) {
intValue |= rawBytes[i] << (8 * i);
}
/*
Let intValue be the byte elements of rawBytes concatenated and interpreted as a bit string encoding of an unsigned little-endian binary number.
*/
if ($charAt(type, 0) !== 'U') { // steps 5-6
// Let intValue be the byte elements of rawBytes concatenated and interpreted as a bit string encoding of a binary little-endian 2's complement number of bit length elementSize × 8.
var bitLength = elementSize * 8;
if (bitLength < 32) {
intValue = (intValue << (32 - bitLength)) >> (32 - bitLength);
}
}
return intValue; // step 7
return bytesAsInteger(rawBytes, elementSize, $charAt(type, 0) === 'U', false);
};

View file

@ -11,7 +11,7 @@ var Get = require('./Get');
var IsCallable = require('./IsCallable');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-regexpexec
// https://262.ecma-international.org/6.0/#sec-regexpexec
module.exports = function RegExpExec(R, S) {
if (Type(R) !== 'Object') {

View file

@ -2,7 +2,7 @@
var $isNaN = require('../helpers/isNaN');
// https://ecma-international.org/ecma-262/6.0/#sec-samevaluezero
// https://262.ecma-international.org/6.0/#sec-samevaluezero
module.exports = function SameValueZero(x, y) {
return (x === y) || ($isNaN(x) && $isNaN(y));

View file

@ -18,7 +18,7 @@ var noThrowOnStrictViolation = (function () {
}
}());
// https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw
// https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw
module.exports = function Set(O, P, V, Throw) {
if (Type(O) !== 'Object') {

View file

@ -12,7 +12,7 @@ var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
var IsExtensible = require('./IsExtensible');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname
// https://262.ecma-international.org/6.0/#sec-setfunctionname
module.exports = function SetFunctionName(F, name) {
if (typeof F !== 'function') {

View file

@ -15,7 +15,7 @@ var IsAccessorDescriptor = require('./IsAccessorDescriptor');
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-setintegritylevel
// https://262.ecma-international.org/6.0/#sec-setintegritylevel
module.exports = function SetIntegrityLevel(O, level) {
if (Type(O) !== 'Object') {

120
node_modules/es-abstract/2017/SetValueInBuffer.js generated vendored Normal file
View file

@ -0,0 +1,120 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var isInteger = require('../helpers/isInteger');
var IsDetachedBuffer = require('./IsDetachedBuffer');
var ToInt16 = require('./ToInt16');
var ToInt32 = require('./ToInt32');
var ToInt8 = require('./ToInt8');
var ToUint16 = require('./ToUint16');
var ToUint32 = require('./ToUint32');
var ToUint8 = require('./ToUint8');
var ToUint8Clamp = require('./ToUint8Clamp');
var isArrayBuffer = require('is-array-buffer');
var has = require('has');
var table49 = {
__proto__: null,
Int8: 1,
Uint8: 1,
Uint8C: 1,
Int16: 2,
Uint16: 2,
Int32: 4,
Uint32: 4,
Float32: 4,
Float64: 8
};
var TypeToAO = {
__proto__: null,
Int8: ToInt8,
Uint8: ToUint8,
Uint8C: ToUint8Clamp,
Int16: ToInt16,
Uint16: ToUint16,
Int32: ToInt32,
Uint32: ToUint32
};
var defaultEndianness = require('../helpers/defaultEndianness');
var forEach = require('../helpers/forEach');
var integerToNBytes = require('../helpers/integerToNBytes');
var valueToFloat32Bytes = require('../helpers/valueToFloat32Bytes');
var valueToFloat64Bytes = require('../helpers/valueToFloat64Bytes');
// https://262.ecma-international.org/6.0/#sec-setvalueinbuffer
module.exports = function SetValueInBuffer(arrayBuffer, byteIndex, type, value) {
if (!isArrayBuffer(arrayBuffer)) {
throw new $TypeError('Assertion failed: `arrayBuffer` must be an ArrayBuffer');
}
if (!isInteger(byteIndex)) {
throw new $TypeError('Assertion failed: `byteIndex` must be an integer');
}
if (typeof type !== 'string' || !has(table49, type)) {
throw new $TypeError('Assertion failed: `type` must be a Typed Array Element Type');
}
if (typeof value !== 'number') {
throw new $TypeError('Assertion failed: `value` must be a number');
}
if (arguments.length > 4 && typeof arguments[4] !== 'boolean') {
throw new $TypeError('Assertion failed: `isLittleEndian` must be a boolean, if present');
}
if (IsDetachedBuffer(arrayBuffer)) {
throw new $TypeError('Assertion failed: ArrayBuffer is detached'); // step 1
}
// 2. Assert: There are sufficient bytes in arrayBuffer starting at byteIndex to represent a value of type.
if (byteIndex < 0) {
throw new $TypeError('Assertion failed: `byteIndex` must be non-negative'); // step 3
}
// 4. Assert: Type(value) is Number.
// 5. Let block be arrayBuffers [[ArrayBufferData]] internal slot.
// 6. Assert: block is not undefined.
var elementSize = table49[type]; // step 7
if (!elementSize) {
throw new $TypeError('Assertion failed: `type` must be one of "Int8", "Uint8", "Uint8C", "Int16", "Uint16", "Int32", "Uint32", "Float32", or "Float64"');
}
// 8. If isLittleEndian is not present, set isLittleEndian to either true or false. The choice is implementation dependent and should be the alternative that is most efficient for the implementation. An implementation must use the same value each time this step is executed and the same value must be used for the corresponding step in the GetValueFromBuffer abstract operation.
var isLittleEndian = arguments.length > 4 ? arguments[4] : defaultEndianness === 'little'; // step 8
var rawBytes;
if (type === 'Float32') { // step 1
rawBytes = valueToFloat32Bytes(value, isLittleEndian);
} else if (type === 'Float64') { // step 2
rawBytes = valueToFloat64Bytes(value, isLittleEndian);
} else {
var n = table49[type]; // step 3.a
var convOp = TypeToAO[type]; // step 3.b
var intValue = convOp(value); // step 3.c
rawBytes = integerToNBytes(intValue, n, isLittleEndian); // step 3.d, 3.e, 4
}
// 12. Store the individual bytes of rawBytes into block, in order, starting at block[byteIndex].
var arr = new Uint8Array(arrayBuffer, byteIndex, elementSize);
forEach(rawBytes, function (rawByte, i) {
arr[i] = rawByte;
});
// 13. Return NormalCompletion(undefined).
};

View file

@ -8,7 +8,7 @@ var $TypeError = GetIntrinsic('%TypeError%');
var IsConstructor = require('./IsConstructor');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor
// https://262.ecma-international.org/6.0/#sec-speciesconstructor
module.exports = function SpeciesConstructor(O, defaultConstructor) {
if (Type(O) !== 'Object') {

View file

@ -5,9 +5,10 @@ var callBound = require('call-bind/callBound');
var $TypeError = GetIntrinsic('%TypeError%');
var IsInteger = require('./IsInteger');
var Type = require('./Type');
var isInteger = require('../helpers/isInteger');
var $charAt = callBound('String.prototype.charAt');
// https://262.ecma-international.org/6.0/#sec-splitmatch
@ -16,7 +17,7 @@ module.exports = function SplitMatch(S, q, R) {
if (Type(S) !== 'String') {
throw new $TypeError('Assertion failed: `S` must be a String');
}
if (!IsInteger(q)) {
if (!isInteger(q)) {
throw new $TypeError('Assertion failed: `q` must be an integer');
}
if (Type(R) !== 'String') {

View file

@ -10,7 +10,7 @@ var $SymbolToString = callBound('Symbol.prototype.toString', true);
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring
// https://262.ecma-international.org/6.0/#sec-symboldescriptivestring
module.exports = function SymbolDescriptiveString(sym) {
if (Type(sym) !== 'Symbol') {

View file

@ -13,7 +13,7 @@ var IsExtensible = require('./IsExtensible');
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-testintegritylevel
// https://262.ecma-international.org/6.0/#sec-testintegritylevel
module.exports = function TestIntegrityLevel(O, level) {
if (Type(O) !== 'Object') {

View file

@ -4,12 +4,13 @@ var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var $Date = GetIntrinsic('%Date%');
var $String = GetIntrinsic('%String%');
var $isNaN = require('../helpers/isNaN');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-todatestring
// https://262.ecma-international.org/6.0/#sec-todatestring
module.exports = function ToDateString(tv) {
if (Type(tv) !== 'Number') {
@ -18,5 +19,5 @@ module.exports = function ToDateString(tv) {
if ($isNaN(tv)) {
return 'Invalid Date';
}
return $Date(tv);
return $String(new $Date(tv));
};

View file

@ -2,7 +2,7 @@
var ToUint16 = require('./ToUint16');
// https://ecma-international.org/ecma-262/6.0/#sec-toint16
// https://262.ecma-international.org/6.0/#sec-toint16
module.exports = function ToInt16(argument) {
var int16bit = ToUint16(argument);

View file

@ -2,7 +2,7 @@
var ToUint8 = require('./ToUint8');
// https://ecma-international.org/ecma-262/6.0/#sec-toint8
// https://262.ecma-international.org/6.0/#sec-toint8
module.exports = function ToInt8(argument) {
var int8bit = ToUint8(argument);

View file

@ -4,7 +4,7 @@ var ES5ToInteger = require('../5/ToInteger');
var ToNumber = require('./ToNumber');
// https://ecma-international.org/ecma-262/6.0/#sec-tointeger
// https://262.ecma-international.org/6.0/#sec-tointeger
module.exports = function ToInteger(value) {
var number = ToNumber(value);

View file

@ -19,22 +19,11 @@ 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 $trim = require('string.prototype.trim');
var ToPrimitive = require('./ToPrimitive');
// https://ecma-international.org/ecma-262/6.0/#sec-tonumber
// https://262.ecma-international.org/6.0/#sec-tonumber
module.exports = function ToNumber(argument) {
var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);

View file

@ -6,7 +6,7 @@ var $Object = GetIntrinsic('%Object%');
var RequireObjectCoercible = require('./RequireObjectCoercible');
// https://ecma-international.org/ecma-262/6.0/#sec-toobject
// https://262.ecma-international.org/6.0/#sec-toobject
module.exports = function ToObject(value) {
RequireObjectCoercible(value);

View file

@ -2,7 +2,7 @@
var toPrimitive = require('es-to-primitive/es2015');
// https://ecma-international.org/ecma-262/6.0/#sec-toprimitive
// https://262.ecma-international.org/6.0/#sec-toprimitive
module.exports = function ToPrimitive(input) {
if (arguments.length > 1) {

View file

@ -7,7 +7,7 @@ var $String = GetIntrinsic('%String%');
var ToPrimitive = require('./ToPrimitive');
var ToString = require('./ToString');
// https://ecma-international.org/ecma-262/6.0/#sec-topropertykey
// https://262.ecma-international.org/6.0/#sec-topropertykey
module.exports = function ToPropertyKey(argument) {
var key = ToPrimitive(argument, $String);

View file

@ -5,7 +5,7 @@ var GetIntrinsic = require('get-intrinsic');
var $String = GetIntrinsic('%String%');
var $TypeError = GetIntrinsic('%TypeError%');
// https://ecma-international.org/ecma-262/6.0/#sec-tostring
// https://262.ecma-international.org/6.0/#sec-tostring
module.exports = function ToString(argument) {
if (typeof argument === 'symbol') {

View file

@ -10,7 +10,7 @@ var abs = require('./abs');
var floor = require('./floor');
var modulo = require('./modulo');
// https://ecma-international.org/ecma-262/6.0/#sec-touint8
// https://262.ecma-international.org/6.0/#sec-touint8
module.exports = function ToUint8(argument) {
var number = ToNumber(argument);

View file

@ -5,13 +5,13 @@ var floor = require('./floor');
var $isNaN = require('../helpers/isNaN');
// https://ecma-international.org/ecma-262/6.0/#sec-touint8clamp
// https://262.ecma-international.org/6.0/#sec-touint8clamp
module.exports = function ToUint8Clamp(argument) {
var number = ToNumber(argument);
if ($isNaN(number) || number <= 0) { return 0; }
if (number >= 0xFF) { return 0xFF; }
var f = floor(argument);
var f = floor(number);
if (f + 0.5 < number) { return f + 1; }
if (number < f + 0.5) { return f; }
if (f % 2 !== 0) { return f + 1; }

View file

@ -2,7 +2,7 @@
var ES5Type = require('../5/Type');
// https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values
// https://262.ecma-international.org/6.0/#sec-ecmascript-data-types-and-values
module.exports = function Type(x) {
if (typeof x === 'symbol') {

50
node_modules/es-abstract/2017/TypedArrayCreate.js generated vendored Normal file
View file

@ -0,0 +1,50 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $TypeError = GetIntrinsic('%TypeError%');
var IsArray = require('./IsArray');
var IsConstructor = require('./IsConstructor');
var Type = require('./Type');
var ValidateTypedArray = require('./ValidateTypedArray');
var availableTypedArrays = require('available-typed-arrays')();
var typedArrayLength = require('typed-array-length');
// https://262.ecma-international.org/7.0/#typedarray-create
module.exports = function TypedArrayCreate(constructor, argumentList) {
if (!IsConstructor(constructor)) {
throw new $TypeError('Assertion failed: `constructor` must be a constructor');
}
if (!IsArray(argumentList)) {
throw new $TypeError('Assertion failed: `argumentList` must be a List');
}
if (availableTypedArrays.length === 0) {
throw new $SyntaxError('Assertion failed: Typed Arrays are not supported in this environment');
}
// var newTypedArray = Construct(constructor, argumentList); // step 1
var newTypedArray;
if (argumentList.length === 0) {
newTypedArray = new constructor();
} else if (argumentList.length === 1) {
newTypedArray = new constructor(argumentList[0]);
} else if (argumentList.length === 2) {
newTypedArray = new constructor(argumentList[0], argumentList[1]);
} else {
newTypedArray = new constructor(argumentList[0], argumentList[1], argumentList[2]);
}
ValidateTypedArray(newTypedArray); // step 2
if (argumentList.length === 1 && Type(argumentList[0]) === 'Number') { // step 3
if (typedArrayLength(newTypedArray) < argumentList[0]) {
throw new $TypeError('Assertion failed: `argumentList[0]` must be <= `newTypedArray.length`'); // step 3.a
}
}
return newTypedArray; // step 4
};

View file

@ -0,0 +1,39 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $TypeError = GetIntrinsic('%TypeError%');
var whichTypedArray = require('which-typed-array');
var availableTypedArrays = require('available-typed-arrays')();
var IsArray = require('./IsArray');
var SpeciesConstructor = require('./SpeciesConstructor');
var TypedArrayCreate = require('./TypedArrayCreate');
var getConstructor = require('../helpers/typedArrayContructors');
// https://262.ecma-international.org/7.0/#typedarray-species-create
module.exports = function TypedArraySpeciesCreate(exemplar, argumentList) {
if (availableTypedArrays.length === 0) {
throw new $SyntaxError('Assertion failed: Typed Arrays are not supported in this environment');
}
var kind = whichTypedArray(exemplar);
if (!kind) {
throw new $TypeError('Assertion failed: exemplar must be a TypedArray'); // step 1
}
if (!IsArray(argumentList)) {
throw new $TypeError('Assertion failed: `argumentList` must be a List'); // step 1
}
var defaultConstructor = getConstructor(kind); // step 2
if (typeof defaultConstructor !== 'function') {
throw new $SyntaxError('Assertion failed: `constructor` of `exemplar` (' + kind + ') must exist. Please report this!');
}
var constructor = SpeciesConstructor(exemplar, defaultConstructor); // step 3
return TypedArrayCreate(constructor, argumentList); // step 4
};

View file

@ -16,10 +16,10 @@ var IsPropertyKey = require('./IsPropertyKey');
var SameValue = require('./SameValue');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-validateandapplypropertydescriptor
// https://ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor
// https://262.ecma-international.org/6.0/#sec-validateandapplypropertydescriptor
// https://262.ecma-international.org/8.0/#sec-validateandapplypropertydescriptor
// eslint-disable-next-line max-lines-per-function, max-statements, max-params
// eslint-disable-next-line max-lines-per-function, max-statements
module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) {
// this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic.
var oType = Type(O);

View file

@ -5,7 +5,7 @@ var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var callBound = require('call-bind/callBound');
var $taSome = callBound('%TypedArray.prototype.some%', true);
var $taSome = callBound('TypedArray.prototype.some', true);
var Type = require('./Type');

49
node_modules/es-abstract/2017/WordCharacters.js generated vendored Normal file
View file

@ -0,0 +1,49 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var callBound = require('call-bind/callBound');
var $indexOf = callBound('String.prototype.indexOf', true);
var Canonicalize = require('./Canonicalize');
var Type = require('./Type');
var caseFolding = require('../helpers/caseFolding');
var forEach = require('../helpers/forEach');
var OwnPropertyKeys = require('../helpers/OwnPropertyKeys');
var A = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'; // step 1
// https://262.ecma-international.org/8.0/#sec-runtime-semantics-wordcharacters-abstract-operation
module.exports = function WordCharacters(IgnoreCase, Unicode) {
if (Type(IgnoreCase) !== 'Boolean' || Type(Unicode) !== 'Boolean') {
throw new $TypeError('Assertion failed: `IgnoreCase` and `Unicode` must be booleans');
}
var U = '';
forEach(OwnPropertyKeys(caseFolding.C), function (c) {
if (
$indexOf(A, c) === -1 // c not in A
&& $indexOf(A, Canonicalize(c, IgnoreCase, Unicode)) > -1 // canonicalized c IS in A
) {
U += caseFolding.C[c]; // step 3
}
});
forEach(OwnPropertyKeys(caseFolding.S), function (c) {
if (
$indexOf(A, c) === -1 // c not in A
&& $indexOf(A, Canonicalize(c, IgnoreCase, Unicode)) > -1 // canonicalized c IS in A
) {
U += caseFolding.S[c]; // step 3
}
});
if ((!Unicode || !IgnoreCase) && U.length > 0) {
throw new $TypeError('Assertion failed: `U` must be empty when `IgnoreCase` and `Unicode` are not both true'); // step 4
}
return A + U; // step 5, 6
};

View file

@ -4,7 +4,7 @@ var $BooleanValueOf = require('call-bind/callBound')('Boolean.prototype.valueOf'
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object
// https://262.ecma-international.org/6.0/#sec-properties-of-the-boolean-prototype-object
module.exports = function thisBooleanValue(value) {
if (Type(value) === 'Boolean') {

View file

@ -6,7 +6,7 @@ var Type = require('./Type');
var $NumberValueOf = callBound('Number.prototype.valueOf');
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object
// https://262.ecma-international.org/6.0/#sec-properties-of-the-number-prototype-object
module.exports = function thisNumberValue(value) {
if (Type(value) === 'Number') {

View file

@ -4,7 +4,7 @@ var $StringValueOf = require('call-bind/callBound')('String.prototype.valueOf');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object
// https://262.ecma-international.org/6.0/#sec-properties-of-the-string-prototype-object
module.exports = function thisStringValue(value) {
if (Type(value) === 'String') {

View file

@ -2,7 +2,7 @@
var $DateGetTime = require('call-bind/callBound')('Date.prototype.getTime');
// https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object
// https://262.ecma-international.org/6.0/#sec-properties-of-the-date-prototype-object
module.exports = function thisTimeValue(value) {
return $DateGetTime(value);