Upload folder using huggingface_hub (part 32)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- tools/ui/node_modules/es-abstract/2024/ArrayCreate.js +42 -0
- tools/ui/node_modules/es-abstract/2024/ArraySetLength.js +77 -0
- tools/ui/node_modules/es-abstract/2024/ArraySpeciesCreate.js +48 -0
- tools/ui/node_modules/es-abstract/2024/AsyncFromSyncIteratorContinuation.js +45 -0
- tools/ui/node_modules/es-abstract/2024/AsyncIteratorClose.js +70 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/add.js +14 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/bitwiseAND.js +14 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/bitwiseNOT.js +15 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/bitwiseOR.js +14 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/bitwiseXOR.js +14 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/divide.js +20 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/equal.js +13 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/exponentiate.js +29 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/index.js +39 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/leftShift.js +14 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/lessThan.js +14 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/multiply.js +14 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/remainder.js +28 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/signedRightShift.js +15 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/subtract.js +14 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/toString.js +26 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/unaryMinus.js +22 -0
- tools/ui/node_modules/es-abstract/2024/BigInt/unsignedRightShift.js +13 -0
- tools/ui/node_modules/es-abstract/2024/BigIntBitwiseOp.js +63 -0
- tools/ui/node_modules/es-abstract/2024/BinaryAnd.js +12 -0
- tools/ui/node_modules/es-abstract/2024/BinaryOr.js +12 -0
- tools/ui/node_modules/es-abstract/2024/BinaryXor.js +12 -0
- tools/ui/node_modules/es-abstract/2024/ByteListBitwiseOp.js +39 -0
- tools/ui/node_modules/es-abstract/2024/ByteListEqual.js +31 -0
- tools/ui/node_modules/es-abstract/2024/Call.js +20 -0
- tools/ui/node_modules/es-abstract/2024/CanBeHeldWeakly.js +17 -0
- tools/ui/node_modules/es-abstract/2024/CanonicalNumericIndexString.js +19 -0
- tools/ui/node_modules/es-abstract/2024/Canonicalize.js +52 -0
- tools/ui/node_modules/es-abstract/2024/CharacterComplement.js +34 -0
- tools/ui/node_modules/es-abstract/2024/CharacterRange.js +53 -0
- tools/ui/node_modules/es-abstract/2024/ClearKeptObjects.js +12 -0
- tools/ui/node_modules/es-abstract/2024/CloneArrayBuffer.js +46 -0
- tools/ui/node_modules/es-abstract/2024/CodePointAt.js +55 -0
- tools/ui/node_modules/es-abstract/2024/CodePointsToString.js +25 -0
- tools/ui/node_modules/es-abstract/2024/CompareArrayElements.js +50 -0
- tools/ui/node_modules/es-abstract/2024/CompareTypedArrayElements.js +60 -0
- tools/ui/node_modules/es-abstract/2024/CompletePropertyDescriptor.js +43 -0
- tools/ui/node_modules/es-abstract/2024/CompletionRecord.js +48 -0
- tools/ui/node_modules/es-abstract/2024/CopyDataProperties.js +69 -0
- tools/ui/node_modules/es-abstract/2024/CreateAsyncFromSyncIterator.js +137 -0
- tools/ui/node_modules/es-abstract/2024/CreateDataProperty.js +25 -0
- tools/ui/node_modules/es-abstract/2024/CreateDataPropertyOrThrow.js +23 -0
- tools/ui/node_modules/es-abstract/2024/CreateHTML.js +27 -0
- tools/ui/node_modules/es-abstract/2024/CreateIterResultObject.js +15 -0
- tools/ui/node_modules/es-abstract/2024/CreateListFromArrayLike.js +44 -0
tools/ui/node_modules/es-abstract/2024/ArrayCreate.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $ArrayPrototype = GetIntrinsic('%Array.prototype%');
|
| 6 |
+
var $RangeError = require('es-errors/range');
|
| 7 |
+
var $SyntaxError = require('es-errors/syntax');
|
| 8 |
+
var $TypeError = require('es-errors/type');
|
| 9 |
+
var isInteger = require('math-intrinsics/isInteger');
|
| 10 |
+
var MAX_ARRAY_LENGTH = require('math-intrinsics/constants/maxArrayLength');
|
| 11 |
+
var $setProto = require('set-proto');
|
| 12 |
+
|
| 13 |
+
// https://262.ecma-international.org/12.0/#sec-arraycreate
|
| 14 |
+
|
| 15 |
+
module.exports = function ArrayCreate(length) {
|
| 16 |
+
if (!isInteger(length) || length < 0) {
|
| 17 |
+
throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0');
|
| 18 |
+
}
|
| 19 |
+
if (length > MAX_ARRAY_LENGTH) {
|
| 20 |
+
throw new $RangeError('length is greater than (2**32 - 1)');
|
| 21 |
+
}
|
| 22 |
+
var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype;
|
| 23 |
+
var A = []; // steps 3, 5
|
| 24 |
+
if (proto !== $ArrayPrototype) { // step 4
|
| 25 |
+
if (!$setProto) {
|
| 26 |
+
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]]');
|
| 27 |
+
}
|
| 28 |
+
$setProto(A, proto);
|
| 29 |
+
}
|
| 30 |
+
if (length !== 0) { // bypasses the need for step 6
|
| 31 |
+
A.length = length;
|
| 32 |
+
}
|
| 33 |
+
/* step 6, the above as a shortcut for the below
|
| 34 |
+
OrdinaryDefineOwnProperty(A, 'length', {
|
| 35 |
+
'[[Configurable]]': false,
|
| 36 |
+
'[[Enumerable]]': false,
|
| 37 |
+
'[[Value]]': length,
|
| 38 |
+
'[[Writable]]': true
|
| 39 |
+
});
|
| 40 |
+
*/
|
| 41 |
+
return A;
|
| 42 |
+
};
|
tools/ui/node_modules/es-abstract/2024/ArraySetLength.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $RangeError = require('es-errors/range');
|
| 4 |
+
var $TypeError = require('es-errors/type');
|
| 5 |
+
|
| 6 |
+
var assign = require('object.assign');
|
| 7 |
+
|
| 8 |
+
var isPropertyDescriptor = require('../helpers/records/property-descriptor');
|
| 9 |
+
|
| 10 |
+
var IsArray = require('./IsArray');
|
| 11 |
+
var IsDataDescriptor = require('./IsDataDescriptor');
|
| 12 |
+
var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty');
|
| 13 |
+
var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty');
|
| 14 |
+
var ToNumber = require('./ToNumber');
|
| 15 |
+
var ToString = require('./ToString');
|
| 16 |
+
var ToUint32 = require('./ToUint32');
|
| 17 |
+
|
| 18 |
+
// https://262.ecma-international.org/6.0/#sec-arraysetlength
|
| 19 |
+
|
| 20 |
+
// eslint-disable-next-line max-statements, max-lines-per-function
|
| 21 |
+
module.exports = function ArraySetLength(A, Desc) {
|
| 22 |
+
if (!IsArray(A)) {
|
| 23 |
+
throw new $TypeError('Assertion failed: A must be an Array');
|
| 24 |
+
}
|
| 25 |
+
if (!isPropertyDescriptor(Desc)) {
|
| 26 |
+
throw new $TypeError('Assertion failed: Desc must be a Property Descriptor');
|
| 27 |
+
}
|
| 28 |
+
if (!('[[Value]]' in Desc)) {
|
| 29 |
+
return OrdinaryDefineOwnProperty(A, 'length', Desc);
|
| 30 |
+
}
|
| 31 |
+
var newLenDesc = assign({}, Desc);
|
| 32 |
+
var newLen = ToUint32(Desc['[[Value]]']);
|
| 33 |
+
var numberLen = ToNumber(Desc['[[Value]]']);
|
| 34 |
+
if (newLen !== numberLen) {
|
| 35 |
+
throw new $RangeError('Invalid array length');
|
| 36 |
+
}
|
| 37 |
+
newLenDesc['[[Value]]'] = newLen;
|
| 38 |
+
var oldLenDesc = OrdinaryGetOwnProperty(A, 'length');
|
| 39 |
+
if (!IsDataDescriptor(oldLenDesc)) {
|
| 40 |
+
throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`');
|
| 41 |
+
}
|
| 42 |
+
var oldLen = oldLenDesc['[[Value]]'];
|
| 43 |
+
if (newLen >= oldLen) {
|
| 44 |
+
return OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
|
| 45 |
+
}
|
| 46 |
+
if (!oldLenDesc['[[Writable]]']) {
|
| 47 |
+
return false;
|
| 48 |
+
}
|
| 49 |
+
var newWritable;
|
| 50 |
+
if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) {
|
| 51 |
+
newWritable = true;
|
| 52 |
+
} else {
|
| 53 |
+
newWritable = false;
|
| 54 |
+
newLenDesc['[[Writable]]'] = true;
|
| 55 |
+
}
|
| 56 |
+
var succeeded = OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
|
| 57 |
+
if (!succeeded) {
|
| 58 |
+
return false;
|
| 59 |
+
}
|
| 60 |
+
while (newLen < oldLen) {
|
| 61 |
+
oldLen -= 1;
|
| 62 |
+
// eslint-disable-next-line no-param-reassign
|
| 63 |
+
var deleteSucceeded = delete A[ToString(oldLen)];
|
| 64 |
+
if (!deleteSucceeded) {
|
| 65 |
+
newLenDesc['[[Value]]'] = oldLen + 1;
|
| 66 |
+
if (!newWritable) {
|
| 67 |
+
newLenDesc['[[Writable]]'] = false;
|
| 68 |
+
OrdinaryDefineOwnProperty(A, 'length', newLenDesc);
|
| 69 |
+
return false;
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
if (!newWritable) {
|
| 74 |
+
return OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false });
|
| 75 |
+
}
|
| 76 |
+
return true;
|
| 77 |
+
};
|
tools/ui/node_modules/es-abstract/2024/ArraySpeciesCreate.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $species = GetIntrinsic('%Symbol.species%', true);
|
| 6 |
+
var $TypeError = require('es-errors/type');
|
| 7 |
+
var isInteger = require('math-intrinsics/isInteger');
|
| 8 |
+
var isObject = require('es-object-atoms/isObject');
|
| 9 |
+
|
| 10 |
+
var ArrayCreate = require('./ArrayCreate');
|
| 11 |
+
var Get = require('./Get');
|
| 12 |
+
var IsArray = require('./IsArray');
|
| 13 |
+
var IsConstructor = require('./IsConstructor');
|
| 14 |
+
|
| 15 |
+
// https://262.ecma-international.org/12.0/#sec-arrayspeciescreate
|
| 16 |
+
|
| 17 |
+
module.exports = function ArraySpeciesCreate(originalArray, length) {
|
| 18 |
+
if (!isInteger(length) || length < 0) {
|
| 19 |
+
throw new $TypeError('Assertion failed: length must be an integer >= 0');
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
var isArray = IsArray(originalArray);
|
| 23 |
+
if (!isArray) {
|
| 24 |
+
return ArrayCreate(length);
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
var C = Get(originalArray, 'constructor');
|
| 28 |
+
// TODO: figure out how to make a cross-realm normal Array, a same-realm Array
|
| 29 |
+
// if (IsConstructor(C)) {
|
| 30 |
+
// if C is another realm's Array, C = undefined
|
| 31 |
+
// Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
|
| 32 |
+
// }
|
| 33 |
+
if ($species && isObject(C)) {
|
| 34 |
+
C = Get(C, $species);
|
| 35 |
+
if (C === null) {
|
| 36 |
+
C = void 0;
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
if (typeof C === 'undefined') {
|
| 41 |
+
return ArrayCreate(length);
|
| 42 |
+
}
|
| 43 |
+
if (!IsConstructor(C)) {
|
| 44 |
+
throw new $TypeError('C must be a constructor');
|
| 45 |
+
}
|
| 46 |
+
return new C(length); // Construct(C, length);
|
| 47 |
+
};
|
| 48 |
+
|
tools/ui/node_modules/es-abstract/2024/AsyncFromSyncIteratorContinuation.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $SyntaxError = require('es-errors/syntax');
|
| 6 |
+
var $TypeError = require('es-errors/type');
|
| 7 |
+
var isObject = require('es-object-atoms/isObject');
|
| 8 |
+
var $Promise = GetIntrinsic('%Promise%', true);
|
| 9 |
+
|
| 10 |
+
var callBound = require('call-bound');
|
| 11 |
+
|
| 12 |
+
var CreateIterResultObject = require('./CreateIterResultObject');
|
| 13 |
+
var IteratorComplete = require('./IteratorComplete');
|
| 14 |
+
var IteratorValue = require('./IteratorValue');
|
| 15 |
+
var PromiseResolve = require('./PromiseResolve');
|
| 16 |
+
|
| 17 |
+
var $then = callBound('Promise.prototype.then', true);
|
| 18 |
+
|
| 19 |
+
// https://262.ecma-international.org/10.0/#sec-asyncfromsynciteratorcontinuation
|
| 20 |
+
|
| 21 |
+
module.exports = function AsyncFromSyncIteratorContinuation(result) {
|
| 22 |
+
if (!isObject(result)) {
|
| 23 |
+
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
if (arguments.length > 1) {
|
| 27 |
+
throw new $SyntaxError('although AsyncFromSyncIteratorContinuation should take a second argument, it is not used in this implementation');
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!$Promise) {
|
| 31 |
+
throw new $SyntaxError('This environment does not support Promises.');
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return new $Promise(function (resolve) {
|
| 35 |
+
var done = IteratorComplete(result); // step 2
|
| 36 |
+
var value = IteratorValue(result); // step 4
|
| 37 |
+
var valueWrapper = PromiseResolve($Promise, value); // step 6
|
| 38 |
+
|
| 39 |
+
// eslint-disable-next-line no-shadow
|
| 40 |
+
var onFulfilled = function (value) { // steps 8-9
|
| 41 |
+
return CreateIterResultObject(value, done); // step 8.a
|
| 42 |
+
};
|
| 43 |
+
resolve($then(valueWrapper, onFulfilled)); // step 11
|
| 44 |
+
}); // step 12
|
| 45 |
+
};
|
tools/ui/node_modules/es-abstract/2024/AsyncIteratorClose.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $SyntaxError = require('es-errors/syntax');
|
| 6 |
+
var $TypeError = require('es-errors/type');
|
| 7 |
+
var isObject = require('es-object-atoms/isObject');
|
| 8 |
+
var $Promise = GetIntrinsic('%Promise%', true);
|
| 9 |
+
|
| 10 |
+
var Call = require('./Call');
|
| 11 |
+
var CompletionRecord = require('./CompletionRecord');
|
| 12 |
+
var GetMethod = require('./GetMethod');
|
| 13 |
+
|
| 14 |
+
var isIteratorRecord = require('../helpers/records/iterator-record');
|
| 15 |
+
|
| 16 |
+
var callBound = require('call-bound');
|
| 17 |
+
|
| 18 |
+
var $then = callBound('Promise.prototype.then', true);
|
| 19 |
+
|
| 20 |
+
// https://262.ecma-international.org/15.0/#sec-asynciteratorclose
|
| 21 |
+
|
| 22 |
+
module.exports = function AsyncIteratorClose(iteratorRecord, completion) {
|
| 23 |
+
if (!isIteratorRecord(iteratorRecord)) {
|
| 24 |
+
throw new $TypeError('Assertion failed: `iteratorRecord` must be an Iterator Record'); // step 1
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
if (!(completion instanceof CompletionRecord)) {
|
| 28 |
+
throw new $TypeError('Assertion failed: completion is not a Completion Record instance'); // step 2
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!$then) {
|
| 32 |
+
throw new $SyntaxError('This environment does not support Promises.');
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
var iterator = iteratorRecord['[[Iterator]]']; // step 3
|
| 36 |
+
|
| 37 |
+
return $then(
|
| 38 |
+
$then(
|
| 39 |
+
$then(
|
| 40 |
+
new $Promise(function (resolve) {
|
| 41 |
+
resolve(GetMethod(iterator, 'return')); // step 4
|
| 42 |
+
// resolve(Call(ret, iterator, [])); // step 6
|
| 43 |
+
}),
|
| 44 |
+
function (returnV) { // step 5.a
|
| 45 |
+
if (typeof returnV === 'undefined') {
|
| 46 |
+
return completion; // step 5.b
|
| 47 |
+
}
|
| 48 |
+
return Call(returnV, iterator); // step 5.c, 5.d.
|
| 49 |
+
}
|
| 50 |
+
),
|
| 51 |
+
null,
|
| 52 |
+
function (e) {
|
| 53 |
+
if (completion.type() === 'throw') {
|
| 54 |
+
completion['?'](); // step 6
|
| 55 |
+
} else {
|
| 56 |
+
throw e; // step 7
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
),
|
| 60 |
+
function (innerResult) { // step 8
|
| 61 |
+
if (completion.type() === 'throw') {
|
| 62 |
+
completion['?'](); // step 6
|
| 63 |
+
}
|
| 64 |
+
if (!isObject(innerResult)) {
|
| 65 |
+
throw new $TypeError('`innerResult` must be an Object'); // step 10
|
| 66 |
+
}
|
| 67 |
+
return completion;
|
| 68 |
+
}
|
| 69 |
+
);
|
| 70 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/add.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-add
|
| 6 |
+
|
| 7 |
+
module.exports = function BigIntAdd(x, y) {
|
| 8 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
// shortcut for the actual spec mechanics
|
| 13 |
+
return x + y;
|
| 14 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/bitwiseAND.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var BigIntBitwiseOp = require('../BigIntBitwiseOp');
|
| 6 |
+
|
| 7 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-bitwiseAND
|
| 8 |
+
|
| 9 |
+
module.exports = function BigIntBitwiseAND(x, y) {
|
| 10 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 11 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 12 |
+
}
|
| 13 |
+
return BigIntBitwiseOp('&', x, y);
|
| 14 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/bitwiseNOT.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $BigInt = GetIntrinsic('%BigInt%', true);
|
| 6 |
+
var $TypeError = require('es-errors/type');
|
| 7 |
+
|
| 8 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-bitwiseNOT
|
| 9 |
+
|
| 10 |
+
module.exports = function BigIntBitwiseNOT(x) {
|
| 11 |
+
if (typeof x !== 'bigint') {
|
| 12 |
+
throw new $TypeError('Assertion failed: `x` argument must be a BigInt');
|
| 13 |
+
}
|
| 14 |
+
return -x - $BigInt(1);
|
| 15 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/bitwiseOR.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var BigIntBitwiseOp = require('../BigIntBitwiseOp');
|
| 6 |
+
|
| 7 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-bitwiseOR
|
| 8 |
+
|
| 9 |
+
module.exports = function BigIntBitwiseOR(x, y) {
|
| 10 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 11 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 12 |
+
}
|
| 13 |
+
return BigIntBitwiseOp('|', x, y);
|
| 14 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/bitwiseXOR.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var BigIntBitwiseOp = require('../BigIntBitwiseOp');
|
| 6 |
+
|
| 7 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-bitwiseXOR
|
| 8 |
+
|
| 9 |
+
module.exports = function BigIntBitwiseXOR(x, y) {
|
| 10 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 11 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 12 |
+
}
|
| 13 |
+
return BigIntBitwiseOp('^', x, y);
|
| 14 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/divide.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $BigInt = GetIntrinsic('%BigInt%', true);
|
| 6 |
+
var $RangeError = require('es-errors/range');
|
| 7 |
+
var $TypeError = require('es-errors/type');
|
| 8 |
+
|
| 9 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-divide
|
| 10 |
+
|
| 11 |
+
module.exports = function BigIntDivide(x, y) {
|
| 12 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 13 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 14 |
+
}
|
| 15 |
+
if (y === $BigInt(0)) {
|
| 16 |
+
throw new $RangeError('Division by zero');
|
| 17 |
+
}
|
| 18 |
+
// shortcut for the actual spec mechanics
|
| 19 |
+
return x / y;
|
| 20 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/equal.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-equal
|
| 6 |
+
|
| 7 |
+
module.exports = function BigIntEqual(x, y) {
|
| 8 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 10 |
+
}
|
| 11 |
+
// shortcut for the actual spec mechanics
|
| 12 |
+
return x === y;
|
| 13 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/exponentiate.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $BigInt = GetIntrinsic('%BigInt%', true);
|
| 6 |
+
var $RangeError = require('es-errors/range');
|
| 7 |
+
var $TypeError = require('es-errors/type');
|
| 8 |
+
|
| 9 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-exponentiate
|
| 10 |
+
|
| 11 |
+
module.exports = function BigIntExponentiate(base, exponent) {
|
| 12 |
+
if (typeof base !== 'bigint' || typeof exponent !== 'bigint') {
|
| 13 |
+
throw new $TypeError('Assertion failed: `base` and `exponent` arguments must be BigInts');
|
| 14 |
+
}
|
| 15 |
+
if (exponent < $BigInt(0)) {
|
| 16 |
+
throw new $RangeError('Exponent must be positive');
|
| 17 |
+
}
|
| 18 |
+
if (/* base === $BigInt(0) && */ exponent === $BigInt(0)) {
|
| 19 |
+
return $BigInt(1);
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
var square = base;
|
| 23 |
+
var remaining = exponent;
|
| 24 |
+
while (remaining > $BigInt(0)) {
|
| 25 |
+
square += exponent;
|
| 26 |
+
--remaining; // eslint-disable-line no-plusplus
|
| 27 |
+
}
|
| 28 |
+
return square;
|
| 29 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var add = require('./add');
|
| 4 |
+
var bitwiseAND = require('./bitwiseAND');
|
| 5 |
+
var bitwiseNOT = require('./bitwiseNOT');
|
| 6 |
+
var bitwiseOR = require('./bitwiseOR');
|
| 7 |
+
var bitwiseXOR = require('./bitwiseXOR');
|
| 8 |
+
var divide = require('./divide');
|
| 9 |
+
var equal = require('./equal');
|
| 10 |
+
var exponentiate = require('./exponentiate');
|
| 11 |
+
var leftShift = require('./leftShift');
|
| 12 |
+
var lessThan = require('./lessThan');
|
| 13 |
+
var multiply = require('./multiply');
|
| 14 |
+
var remainder = require('./remainder');
|
| 15 |
+
var signedRightShift = require('./signedRightShift');
|
| 16 |
+
var subtract = require('./subtract');
|
| 17 |
+
var toString = require('./toString');
|
| 18 |
+
var unaryMinus = require('./unaryMinus');
|
| 19 |
+
var unsignedRightShift = require('./unsignedRightShift');
|
| 20 |
+
|
| 21 |
+
module.exports = {
|
| 22 |
+
add: add,
|
| 23 |
+
bitwiseAND: bitwiseAND,
|
| 24 |
+
bitwiseNOT: bitwiseNOT,
|
| 25 |
+
bitwiseOR: bitwiseOR,
|
| 26 |
+
bitwiseXOR: bitwiseXOR,
|
| 27 |
+
divide: divide,
|
| 28 |
+
equal: equal,
|
| 29 |
+
exponentiate: exponentiate,
|
| 30 |
+
leftShift: leftShift,
|
| 31 |
+
lessThan: lessThan,
|
| 32 |
+
multiply: multiply,
|
| 33 |
+
remainder: remainder,
|
| 34 |
+
signedRightShift: signedRightShift,
|
| 35 |
+
subtract: subtract,
|
| 36 |
+
toString: toString,
|
| 37 |
+
unaryMinus: unaryMinus,
|
| 38 |
+
unsignedRightShift: unsignedRightShift
|
| 39 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/leftShift.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-leftShift
|
| 6 |
+
|
| 7 |
+
module.exports = function BigIntLeftShift(x, y) {
|
| 8 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
// shortcut for the actual spec mechanics
|
| 13 |
+
return x << y;
|
| 14 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/lessThan.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-lessThan
|
| 6 |
+
|
| 7 |
+
module.exports = function BigIntLessThan(x, y) {
|
| 8 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
// shortcut for the actual spec mechanics
|
| 13 |
+
return x < y;
|
| 14 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/multiply.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-multiply
|
| 6 |
+
|
| 7 |
+
module.exports = function BigIntMultiply(x, y) {
|
| 8 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
// shortcut for the actual spec mechanics
|
| 13 |
+
return x * y;
|
| 14 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/remainder.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $BigInt = GetIntrinsic('%BigInt%', true);
|
| 6 |
+
var $RangeError = require('es-errors/range');
|
| 7 |
+
var $TypeError = require('es-errors/type');
|
| 8 |
+
|
| 9 |
+
var zero = $BigInt && $BigInt(0);
|
| 10 |
+
|
| 11 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-remainder
|
| 12 |
+
|
| 13 |
+
module.exports = function BigIntRemainder(n, d) {
|
| 14 |
+
if (typeof n !== 'bigint' || typeof d !== 'bigint') {
|
| 15 |
+
throw new $TypeError('Assertion failed: `n` and `d` arguments must be BigInts');
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
if (d === zero) {
|
| 19 |
+
throw new $RangeError('Division by zero');
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
if (n === zero) {
|
| 23 |
+
return zero;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
// shortcut for the actual spec mechanics
|
| 27 |
+
return n % d;
|
| 28 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/signedRightShift.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var BigIntLeftShift = require('./leftShift');
|
| 6 |
+
|
| 7 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-signedRightShift
|
| 8 |
+
|
| 9 |
+
module.exports = function BigIntSignedRightShift(x, y) {
|
| 10 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 11 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
return BigIntLeftShift(x, -y);
|
| 15 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/subtract.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-subtract
|
| 6 |
+
|
| 7 |
+
module.exports = function BigIntSubtract(x, y) {
|
| 8 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
// shortcut for the actual spec mechanics
|
| 13 |
+
return x - y;
|
| 14 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/toString.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $SyntaxError = require('es-errors/syntax');
|
| 4 |
+
var $TypeError = require('es-errors/type');
|
| 5 |
+
var callBound = require('call-bound');
|
| 6 |
+
var isInteger = require('math-intrinsics/isInteger');
|
| 7 |
+
|
| 8 |
+
var $BigIntToString = callBound('BigInt.prototype.toString', true);
|
| 9 |
+
|
| 10 |
+
// https://262.ecma-international.org/14.0/#sec-numeric-types-bigint-tostring
|
| 11 |
+
|
| 12 |
+
module.exports = function BigIntToString(x, radix) {
|
| 13 |
+
if (typeof x !== 'bigint') {
|
| 14 |
+
throw new $TypeError('Assertion failed: `x` must be a BigInt');
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
if (!isInteger(radix) || radix < 2 || radix > 36) {
|
| 18 |
+
throw new $TypeError('Assertion failed: `radix` must be an integer >= 2 and <= 36');
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
if (!$BigIntToString) {
|
| 22 |
+
throw new $SyntaxError('BigInt is not supported');
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
return $BigIntToString(x, radix); // steps 1 - 12
|
| 26 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/unaryMinus.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $BigInt = GetIntrinsic('%BigInt%', true);
|
| 6 |
+
var $TypeError = require('es-errors/type');
|
| 7 |
+
|
| 8 |
+
var zero = $BigInt && $BigInt(0);
|
| 9 |
+
|
| 10 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-unaryMinus
|
| 11 |
+
|
| 12 |
+
module.exports = function BigIntUnaryMinus(x) {
|
| 13 |
+
if (typeof x !== 'bigint') {
|
| 14 |
+
throw new $TypeError('Assertion failed: `x` argument must be a BigInt');
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
if (x === zero) {
|
| 18 |
+
return zero;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
return -x;
|
| 22 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigInt/unsignedRightShift.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-unsignedRightShift
|
| 6 |
+
|
| 7 |
+
module.exports = function BigIntUnsignedRightShift(x, y) {
|
| 8 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
throw new $TypeError('BigInts have no unsigned right shift, use >> instead');
|
| 13 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BigIntBitwiseOp.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
// var $BigInt = GetIntrinsic('%BigInt%', true);
|
| 5 |
+
// var $pow = require('math-intrinsics/pow');
|
| 6 |
+
|
| 7 |
+
// var BinaryAnd = require('./BinaryAnd');
|
| 8 |
+
// var BinaryOr = require('./BinaryOr');
|
| 9 |
+
// var BinaryXor = require('./BinaryXor');
|
| 10 |
+
// var modulo = require('./modulo');
|
| 11 |
+
|
| 12 |
+
// var zero = $BigInt && $BigInt(0);
|
| 13 |
+
// var negOne = $BigInt && $BigInt(-1);
|
| 14 |
+
// var two = $BigInt && $BigInt(2);
|
| 15 |
+
|
| 16 |
+
// https://262.ecma-international.org/11.0/#sec-bigintbitwiseop
|
| 17 |
+
|
| 18 |
+
module.exports = function BigIntBitwiseOp(op, x, y) {
|
| 19 |
+
if (op !== '&' && op !== '|' && op !== '^') {
|
| 20 |
+
throw new $TypeError('Assertion failed: `op` must be `&`, `|`, or `^`');
|
| 21 |
+
}
|
| 22 |
+
if (typeof x !== 'bigint' || typeof y !== 'bigint') {
|
| 23 |
+
throw new $TypeError('`x` and `y` must be BigInts');
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
if (op === '&') {
|
| 27 |
+
return x & y;
|
| 28 |
+
}
|
| 29 |
+
if (op === '|') {
|
| 30 |
+
return x | y;
|
| 31 |
+
}
|
| 32 |
+
return x ^ y;
|
| 33 |
+
/*
|
| 34 |
+
var result = zero;
|
| 35 |
+
var shift = 0;
|
| 36 |
+
while (x !== zero && x !== negOne && y !== zero && y !== negOne) {
|
| 37 |
+
var xDigit = modulo(x, two);
|
| 38 |
+
var yDigit = modulo(y, two);
|
| 39 |
+
if (op === '&') {
|
| 40 |
+
result += $pow(2, shift) * BinaryAnd(xDigit, yDigit);
|
| 41 |
+
} else if (op === '|') {
|
| 42 |
+
result += $pow(2, shift) * BinaryOr(xDigit, yDigit);
|
| 43 |
+
} else if (op === '^') {
|
| 44 |
+
result += $pow(2, shift) * BinaryXor(xDigit, yDigit);
|
| 45 |
+
}
|
| 46 |
+
shift += 1;
|
| 47 |
+
x = (x - xDigit) / two;
|
| 48 |
+
y = (y - yDigit) / two;
|
| 49 |
+
}
|
| 50 |
+
var tmp;
|
| 51 |
+
if (op === '&') {
|
| 52 |
+
tmp = BinaryAnd(modulo(x, two), modulo(y, two));
|
| 53 |
+
} else if (op === '|') {
|
| 54 |
+
tmp = BinaryAnd(modulo(x, two), modulo(y, two));
|
| 55 |
+
} else {
|
| 56 |
+
tmp = BinaryXor(modulo(x, two), modulo(y, two));
|
| 57 |
+
}
|
| 58 |
+
if (tmp !== 0) {
|
| 59 |
+
result -= $pow(2, shift);
|
| 60 |
+
}
|
| 61 |
+
return result;
|
| 62 |
+
*/
|
| 63 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BinaryAnd.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-binaryand
|
| 6 |
+
|
| 7 |
+
module.exports = function BinaryAnd(x, y) {
|
| 8 |
+
if ((x !== 0 && x !== 1) || (y !== 0 && y !== 1)) {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` must be either 0 or 1');
|
| 10 |
+
}
|
| 11 |
+
return x & y;
|
| 12 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BinaryOr.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-binaryor
|
| 6 |
+
|
| 7 |
+
module.exports = function BinaryOr(x, y) {
|
| 8 |
+
if ((x !== 0 && x !== 1) || (y !== 0 && y !== 1)) {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` must be either 0 or 1');
|
| 10 |
+
}
|
| 11 |
+
return x | y;
|
| 12 |
+
};
|
tools/ui/node_modules/es-abstract/2024/BinaryXor.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/11.0/#sec-binaryxor
|
| 6 |
+
|
| 7 |
+
module.exports = function BinaryXor(x, y) {
|
| 8 |
+
if ((x !== 0 && x !== 1) || (y !== 0 && y !== 1)) {
|
| 9 |
+
throw new $TypeError('Assertion failed: `x` and `y` must be either 0 or 1');
|
| 10 |
+
}
|
| 11 |
+
return x ^ y;
|
| 12 |
+
};
|
tools/ui/node_modules/es-abstract/2024/ByteListBitwiseOp.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var IsArray = require('./IsArray');
|
| 6 |
+
|
| 7 |
+
var isByteValue = require('../helpers/isByteValue');
|
| 8 |
+
|
| 9 |
+
// https://262.ecma-international.org/12.0/#sec-bytelistbitwiseop
|
| 10 |
+
|
| 11 |
+
module.exports = function ByteListBitwiseOp(op, xBytes, yBytes) {
|
| 12 |
+
if (op !== '&' && op !== '^' && op !== '|') {
|
| 13 |
+
throw new $TypeError('Assertion failed: `op` must be `&`, `^`, or `|`');
|
| 14 |
+
}
|
| 15 |
+
if (!IsArray(xBytes) || !IsArray(yBytes) || xBytes.length !== yBytes.length) {
|
| 16 |
+
throw new $TypeError('Assertion failed: `xBytes` and `yBytes` must be same-length sequences of byte values (an integer 0-255, inclusive)');
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
var result = [];
|
| 20 |
+
|
| 21 |
+
for (var i = 0; i < xBytes.length; i += 1) {
|
| 22 |
+
var xByte = xBytes[i];
|
| 23 |
+
var yByte = yBytes[i];
|
| 24 |
+
if (!isByteValue(xByte) || !isByteValue(yByte)) {
|
| 25 |
+
throw new $TypeError('Assertion failed: `xBytes` and `yBytes` must be same-length sequences of byte values (an integer 0-255, inclusive)');
|
| 26 |
+
}
|
| 27 |
+
var resultByte;
|
| 28 |
+
if (op === '&') {
|
| 29 |
+
resultByte = xByte & yByte;
|
| 30 |
+
} else if (op === '^') {
|
| 31 |
+
resultByte = xByte ^ yByte;
|
| 32 |
+
} else {
|
| 33 |
+
resultByte = xByte | yByte;
|
| 34 |
+
}
|
| 35 |
+
result[result.length] = resultByte;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
return result;
|
| 39 |
+
};
|
tools/ui/node_modules/es-abstract/2024/ByteListEqual.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var IsArray = require('./IsArray');
|
| 6 |
+
|
| 7 |
+
var isByteValue = require('../helpers/isByteValue');
|
| 8 |
+
|
| 9 |
+
// https://262.ecma-international.org/12.0/#sec-bytelistequal
|
| 10 |
+
|
| 11 |
+
module.exports = function ByteListEqual(xBytes, yBytes) {
|
| 12 |
+
if (!IsArray(xBytes) || !IsArray(yBytes)) {
|
| 13 |
+
throw new $TypeError('Assertion failed: `xBytes` and `yBytes` must be sequences of byte values (an integer 0-255, inclusive)');
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
if (xBytes.length !== yBytes.length) {
|
| 17 |
+
return false;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
for (var i = 0; i < xBytes.length; i += 1) {
|
| 21 |
+
var xByte = xBytes[i];
|
| 22 |
+
var yByte = yBytes[i];
|
| 23 |
+
if (!isByteValue(xByte) || !isByteValue(yByte)) {
|
| 24 |
+
throw new $TypeError('Assertion failed: `xBytes` and `yBytes` must be sequences of byte values (an integer 0-255, inclusive)');
|
| 25 |
+
}
|
| 26 |
+
if (xByte !== yByte) {
|
| 27 |
+
return false;
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
return true;
|
| 31 |
+
};
|
tools/ui/node_modules/es-abstract/2024/Call.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
var callBound = require('call-bound');
|
| 5 |
+
|
| 6 |
+
var $TypeError = require('es-errors/type');
|
| 7 |
+
|
| 8 |
+
var IsArray = require('./IsArray');
|
| 9 |
+
|
| 10 |
+
var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');
|
| 11 |
+
|
| 12 |
+
// https://262.ecma-international.org/6.0/#sec-call
|
| 13 |
+
|
| 14 |
+
module.exports = function Call(F, V) {
|
| 15 |
+
var argumentsList = arguments.length > 2 ? arguments[2] : [];
|
| 16 |
+
if (!IsArray(argumentsList)) {
|
| 17 |
+
throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');
|
| 18 |
+
}
|
| 19 |
+
return $apply(F, V, argumentsList);
|
| 20 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CanBeHeldWeakly.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var isObject = require('es-object-atoms/isObject');
|
| 4 |
+
|
| 5 |
+
var KeyForSymbol = require('./KeyForSymbol');
|
| 6 |
+
|
| 7 |
+
// https://262.ecma-international.org/14.0/#sec-canbeheldweakly
|
| 8 |
+
|
| 9 |
+
module.exports = function CanBeHeldWeakly(v) {
|
| 10 |
+
if (isObject(v)) {
|
| 11 |
+
return true; // step 1
|
| 12 |
+
}
|
| 13 |
+
if (typeof v === 'symbol' && typeof KeyForSymbol(v) === 'undefined') {
|
| 14 |
+
return true; // step 2
|
| 15 |
+
}
|
| 16 |
+
return false; // step 3
|
| 17 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CanonicalNumericIndexString.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var SameValue = require('./SameValue');
|
| 6 |
+
var ToNumber = require('./ToNumber');
|
| 7 |
+
var ToString = require('./ToString');
|
| 8 |
+
|
| 9 |
+
// https://262.ecma-international.org/6.0/#sec-canonicalnumericindexstring
|
| 10 |
+
|
| 11 |
+
module.exports = function CanonicalNumericIndexString(argument) {
|
| 12 |
+
if (typeof argument !== 'string') {
|
| 13 |
+
throw new $TypeError('Assertion failed: `argument` must be a String');
|
| 14 |
+
}
|
| 15 |
+
if (argument === '-0') { return -0; }
|
| 16 |
+
var n = ToNumber(argument);
|
| 17 |
+
if (SameValue(ToString(n), argument)) { return n; }
|
| 18 |
+
return void 0;
|
| 19 |
+
};
|
tools/ui/node_modules/es-abstract/2024/Canonicalize.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var callBound = require('call-bound');
|
| 6 |
+
var hasOwn = require('hasown');
|
| 7 |
+
|
| 8 |
+
var $charCodeAt = callBound('String.prototype.charCodeAt');
|
| 9 |
+
var $toUpperCase = callBound('String.prototype.toUpperCase');
|
| 10 |
+
|
| 11 |
+
var isRegExpRecord = require('../helpers/records/regexp-record');
|
| 12 |
+
var caseFolding = require('../helpers/caseFolding.json');
|
| 13 |
+
|
| 14 |
+
// https://262.ecma-international.org/14.0/#sec-runtime-semantics-canonicalize-ch
|
| 15 |
+
|
| 16 |
+
module.exports = function Canonicalize(rer, ch) {
|
| 17 |
+
if (!isRegExpRecord(rer)) {
|
| 18 |
+
throw new $TypeError('Assertion failed: `rer` must be a RegExp Record');
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
if (typeof ch !== 'string') {
|
| 22 |
+
throw new $TypeError('Assertion failed: `ch` must be a character');
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
if (rer['[[Unicode]]'] && rer['[[IgnoreCase]]']) { // step 1
|
| 26 |
+
if (hasOwn(caseFolding.C, ch)) {
|
| 27 |
+
return caseFolding.C[ch];
|
| 28 |
+
}
|
| 29 |
+
if (hasOwn(caseFolding.S, ch)) {
|
| 30 |
+
return caseFolding.S[ch];
|
| 31 |
+
}
|
| 32 |
+
return ch; // step 1.b
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
if (!rer['[[IgnoreCase]]']) {
|
| 36 |
+
return ch; // step 2
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
var u = $toUpperCase(ch); // step 5
|
| 40 |
+
|
| 41 |
+
if (u.length !== 1) {
|
| 42 |
+
return ch; // step 7
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
var cu = u; // step 8
|
| 46 |
+
|
| 47 |
+
if ($charCodeAt(ch, 0) >= 128 && $charCodeAt(cu, 0) < 128) {
|
| 48 |
+
return ch; // step 9
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
return cu; // step 10
|
| 52 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CharacterComplement.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var AllCharacters = require('./AllCharacters');
|
| 6 |
+
|
| 7 |
+
var CharSet = require('../helpers/CharSet').CharSet;
|
| 8 |
+
var isRegExpRecord = require('../helpers/records/regexp-record');
|
| 9 |
+
|
| 10 |
+
// https://262.ecma-international.org/15.0/#sec-charactercomplement
|
| 11 |
+
|
| 12 |
+
module.exports = function CharacterComplement(rer, S) {
|
| 13 |
+
if (!isRegExpRecord(rer)) {
|
| 14 |
+
throw new $TypeError('Assertion failed: `rer` must be a RegExp Record');
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
if (!(S instanceof CharSet)) {
|
| 18 |
+
throw new $TypeError('Assertion failed: S must be a CharSet');
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
var A = AllCharacters(rer); // step 1
|
| 22 |
+
|
| 23 |
+
// 2. Return the CharSet containing the CharSetElements of A which are not also CharSetElements of S.
|
| 24 |
+
return new CharSet(
|
| 25 |
+
function (x) { return !S.test(x) && A.test(x); },
|
| 26 |
+
function (emit) {
|
| 27 |
+
A.yield(function (x) {
|
| 28 |
+
if (!S.test(x)) {
|
| 29 |
+
emit(x);
|
| 30 |
+
}
|
| 31 |
+
});
|
| 32 |
+
}
|
| 33 |
+
);
|
| 34 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CharacterRange.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
var callBound = require('call-bound');
|
| 5 |
+
|
| 6 |
+
var $fromCharCode = GetIntrinsic('%String.fromCharCode%');
|
| 7 |
+
var $TypeError = require('es-errors/type');
|
| 8 |
+
var $charCodeAt = callBound('String.prototype.charCodeAt');
|
| 9 |
+
|
| 10 |
+
var CharSet = require('../helpers/CharSet').CharSet;
|
| 11 |
+
|
| 12 |
+
module.exports = function CharacterRange(A, B) {
|
| 13 |
+
var a;
|
| 14 |
+
var b;
|
| 15 |
+
|
| 16 |
+
if (A instanceof CharSet || B instanceof CharSet) {
|
| 17 |
+
if (!(A instanceof CharSet) || !(B instanceof CharSet)) {
|
| 18 |
+
throw new $TypeError('Assertion failed: CharSets A and B are not both CharSets');
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
A.yield(function (c) {
|
| 22 |
+
if (typeof a !== 'undefined') {
|
| 23 |
+
throw new $TypeError('Assertion failed: CharSet A has more than one character');
|
| 24 |
+
}
|
| 25 |
+
a = c;
|
| 26 |
+
});
|
| 27 |
+
B.yield(function (c) {
|
| 28 |
+
if (typeof b !== 'undefined') {
|
| 29 |
+
throw new $TypeError('Assertion failed: CharSet B has more than one character');
|
| 30 |
+
}
|
| 31 |
+
b = c;
|
| 32 |
+
});
|
| 33 |
+
} else {
|
| 34 |
+
if (A.length !== 1 || B.length !== 1) {
|
| 35 |
+
throw new $TypeError('Assertion failed: CharSets A and B contain exactly one character');
|
| 36 |
+
}
|
| 37 |
+
a = A[0];
|
| 38 |
+
b = B[0];
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
var i = $charCodeAt(a, 0);
|
| 42 |
+
var j = $charCodeAt(b, 0);
|
| 43 |
+
|
| 44 |
+
if (!(i <= j)) {
|
| 45 |
+
throw new $TypeError('Assertion failed: i is not <= j');
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
var arr = [];
|
| 49 |
+
for (var k = i; k <= j; k += 1) {
|
| 50 |
+
arr[arr.length] = $fromCharCode(k);
|
| 51 |
+
}
|
| 52 |
+
return arr;
|
| 53 |
+
};
|
tools/ui/node_modules/es-abstract/2024/ClearKeptObjects.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var SLOT = require('internal-slot');
|
| 4 |
+
var keptObjects = [];
|
| 5 |
+
|
| 6 |
+
// https://262.ecma-international.org/12.0/#sec-clear-kept-objects
|
| 7 |
+
|
| 8 |
+
module.exports = function ClearKeptObjects() {
|
| 9 |
+
keptObjects.length = 0;
|
| 10 |
+
};
|
| 11 |
+
|
| 12 |
+
SLOT.set(module.exports, '[[es-abstract internal: KeptAlive]]', keptObjects);
|
tools/ui/node_modules/es-abstract/2024/CloneArrayBuffer.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var GetPrototypeFromConstructor = require('./GetPrototypeFromConstructor');
|
| 6 |
+
var IsConstructor = require('./IsConstructor');
|
| 7 |
+
var IsDetachedBuffer = require('./IsDetachedBuffer');
|
| 8 |
+
var OrdinarySetPrototypeOf = require('./OrdinarySetPrototypeOf');
|
| 9 |
+
|
| 10 |
+
var isInteger = require('math-intrinsics/isInteger');
|
| 11 |
+
var isArrayBuffer = require('is-array-buffer');
|
| 12 |
+
var arrayBufferSlice = require('arraybuffer.prototype.slice');
|
| 13 |
+
|
| 14 |
+
// https://262.ecma-international.org/12.0/#sec-clonearraybuffer
|
| 15 |
+
|
| 16 |
+
module.exports = function CloneArrayBuffer(srcBuffer, srcByteOffset, srcLength, cloneConstructor) {
|
| 17 |
+
if (!isArrayBuffer(srcBuffer)) {
|
| 18 |
+
throw new $TypeError('Assertion failed: `srcBuffer` must be an ArrayBuffer instance');
|
| 19 |
+
}
|
| 20 |
+
if (!isInteger(srcByteOffset) || srcByteOffset < 0) {
|
| 21 |
+
throw new $TypeError('Assertion failed: `srcByteOffset` must be a non-negative integer');
|
| 22 |
+
}
|
| 23 |
+
if (!isInteger(srcLength) || srcLength < 0) {
|
| 24 |
+
throw new $TypeError('Assertion failed: `srcLength` must be a non-negative integer');
|
| 25 |
+
}
|
| 26 |
+
if (!IsConstructor(cloneConstructor)) {
|
| 27 |
+
throw new $TypeError('Assertion failed: `cloneConstructor` must be a constructor');
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
// 3. Let targetBuffer be ? AllocateArrayBuffer(cloneConstructor, srcLength).
|
| 31 |
+
var proto = GetPrototypeFromConstructor(cloneConstructor, '%ArrayBufferPrototype%'); // step 3, kinda
|
| 32 |
+
|
| 33 |
+
if (IsDetachedBuffer(srcBuffer)) {
|
| 34 |
+
throw new $TypeError('`srcBuffer` must not be a detached ArrayBuffer'); // step 4
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
/*
|
| 38 |
+
5. Let srcBlock be srcBuffer.[[ArrayBufferData]].
|
| 39 |
+
6. Let targetBlock be targetBuffer.[[ArrayBufferData]].
|
| 40 |
+
7. Perform CopyDataBlockBytes(targetBlock, 0, srcBlock, srcByteOffset, srcLength).
|
| 41 |
+
*/
|
| 42 |
+
var targetBuffer = arrayBufferSlice(srcBuffer, srcByteOffset, srcByteOffset + srcLength); // steps 5-7
|
| 43 |
+
OrdinarySetPrototypeOf(targetBuffer, proto); // step 3
|
| 44 |
+
|
| 45 |
+
return targetBuffer; // step 8
|
| 46 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CodePointAt.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
var callBound = require('call-bound');
|
| 5 |
+
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate');
|
| 6 |
+
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate');
|
| 7 |
+
|
| 8 |
+
var UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');
|
| 9 |
+
|
| 10 |
+
var $charAt = callBound('String.prototype.charAt');
|
| 11 |
+
var $charCodeAt = callBound('String.prototype.charCodeAt');
|
| 12 |
+
|
| 13 |
+
// https://262.ecma-international.org/12.0/#sec-codepointat
|
| 14 |
+
|
| 15 |
+
module.exports = function CodePointAt(string, position) {
|
| 16 |
+
if (typeof string !== 'string') {
|
| 17 |
+
throw new $TypeError('Assertion failed: `string` must be a String');
|
| 18 |
+
}
|
| 19 |
+
var size = string.length;
|
| 20 |
+
if (position < 0 || position >= size) {
|
| 21 |
+
throw new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');
|
| 22 |
+
}
|
| 23 |
+
var first = $charCodeAt(string, position);
|
| 24 |
+
var cp = $charAt(string, position);
|
| 25 |
+
var firstIsLeading = isLeadingSurrogate(first);
|
| 26 |
+
var firstIsTrailing = isTrailingSurrogate(first);
|
| 27 |
+
if (!firstIsLeading && !firstIsTrailing) {
|
| 28 |
+
return {
|
| 29 |
+
'[[CodePoint]]': cp,
|
| 30 |
+
'[[CodeUnitCount]]': 1,
|
| 31 |
+
'[[IsUnpairedSurrogate]]': false
|
| 32 |
+
};
|
| 33 |
+
}
|
| 34 |
+
if (firstIsTrailing || (position + 1 === size)) {
|
| 35 |
+
return {
|
| 36 |
+
'[[CodePoint]]': cp,
|
| 37 |
+
'[[CodeUnitCount]]': 1,
|
| 38 |
+
'[[IsUnpairedSurrogate]]': true
|
| 39 |
+
};
|
| 40 |
+
}
|
| 41 |
+
var second = $charCodeAt(string, position + 1);
|
| 42 |
+
if (!isTrailingSurrogate(second)) {
|
| 43 |
+
return {
|
| 44 |
+
'[[CodePoint]]': cp,
|
| 45 |
+
'[[CodeUnitCount]]': 1,
|
| 46 |
+
'[[IsUnpairedSurrogate]]': true
|
| 47 |
+
};
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
return {
|
| 51 |
+
'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),
|
| 52 |
+
'[[CodeUnitCount]]': 2,
|
| 53 |
+
'[[IsUnpairedSurrogate]]': false
|
| 54 |
+
};
|
| 55 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CodePointsToString.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var UTF16EncodeCodePoint = require('./UTF16EncodeCodePoint');
|
| 6 |
+
var IsArray = require('./IsArray');
|
| 7 |
+
|
| 8 |
+
var forEach = require('../helpers/forEach');
|
| 9 |
+
var isCodePoint = require('../helpers/isCodePoint');
|
| 10 |
+
|
| 11 |
+
// https://262.ecma-international.org/12.0/#sec-codepointstostring
|
| 12 |
+
|
| 13 |
+
module.exports = function CodePointsToString(text) {
|
| 14 |
+
if (!IsArray(text)) {
|
| 15 |
+
throw new $TypeError('Assertion failed: `text` must be a sequence of Unicode Code Points');
|
| 16 |
+
}
|
| 17 |
+
var result = '';
|
| 18 |
+
forEach(text, function (cp) {
|
| 19 |
+
if (!isCodePoint(cp)) {
|
| 20 |
+
throw new $TypeError('Assertion failed: `text` must be a sequence of Unicode Code Points');
|
| 21 |
+
}
|
| 22 |
+
result += UTF16EncodeCodePoint(cp);
|
| 23 |
+
});
|
| 24 |
+
return result;
|
| 25 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CompareArrayElements.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var Call = require('./Call');
|
| 6 |
+
var IsLessThan = require('./IsLessThan');
|
| 7 |
+
var ToNumber = require('./ToNumber');
|
| 8 |
+
var ToString = require('./ToString');
|
| 9 |
+
|
| 10 |
+
var isNaN = require('math-intrinsics/isNaN');
|
| 11 |
+
|
| 12 |
+
// https://262.ecma-international.org/14.0/#sec-comparearrayelements
|
| 13 |
+
|
| 14 |
+
module.exports = function CompareArrayElements(x, y, compareFn) {
|
| 15 |
+
if (typeof compareFn !== 'function' && typeof compareFn !== 'undefined') {
|
| 16 |
+
throw new $TypeError('Assertion failed: `compareFn` must be a function or undefined');
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
if (typeof x === 'undefined' && typeof y === 'undefined') {
|
| 20 |
+
return 0; // step 1
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
if (typeof x === 'undefined') {
|
| 24 |
+
return 1; // step 2
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
if (typeof y === 'undefined') {
|
| 28 |
+
return -1; // step 3
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (typeof compareFn !== 'undefined') { // step 4
|
| 32 |
+
var v = ToNumber(Call(compareFn, void undefined, [x, y])); // step 4.a
|
| 33 |
+
if (isNaN(v)) {
|
| 34 |
+
return 0; // step 4.b
|
| 35 |
+
}
|
| 36 |
+
return v; // step 4.c
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
var xString = ToString(x); // step 5
|
| 40 |
+
var yString = ToString(y); // step 6
|
| 41 |
+
var xSmaller = IsLessThan(xString, yString, true); // step 7
|
| 42 |
+
if (xSmaller) {
|
| 43 |
+
return -1; // step 8
|
| 44 |
+
}
|
| 45 |
+
var ySmaller = IsLessThan(yString, xString, true); // step 9
|
| 46 |
+
if (ySmaller) {
|
| 47 |
+
return 1; // step 10
|
| 48 |
+
}
|
| 49 |
+
return 0; // step 11
|
| 50 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CompareTypedArrayElements.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var Call = require('./Call');
|
| 6 |
+
var SameValue = require('./SameValue');
|
| 7 |
+
var ToNumber = require('./ToNumber');
|
| 8 |
+
|
| 9 |
+
var isNaN = require('math-intrinsics/isNaN');
|
| 10 |
+
|
| 11 |
+
// https://262.ecma-international.org/14.0/#sec-comparetypedarrayelements
|
| 12 |
+
|
| 13 |
+
module.exports = function CompareTypedArrayElements(x, y, compareFn) {
|
| 14 |
+
if ((typeof x !== 'number' && typeof x !== 'bigint') || typeof x !== typeof y) {
|
| 15 |
+
throw new $TypeError('Assertion failed: `x` and `y` must be either a BigInt or a Number, and both must be the same type');
|
| 16 |
+
}
|
| 17 |
+
if (typeof compareFn !== 'function' && typeof compareFn !== 'undefined') {
|
| 18 |
+
throw new $TypeError('Assertion failed: `compareFn` must be a function or undefined');
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
if (typeof compareFn !== 'undefined') { // step 2
|
| 22 |
+
var v = ToNumber(Call(compareFn, void undefined, [x, y])); // step 2.a
|
| 23 |
+
if (isNaN(v)) {
|
| 24 |
+
return 0; // step 2.b
|
| 25 |
+
}
|
| 26 |
+
return v; // step 2.c
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
var xNaN = isNaN(x);
|
| 30 |
+
var yNaN = isNaN(y);
|
| 31 |
+
if (xNaN && yNaN) {
|
| 32 |
+
return 0; // step 3
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
if (xNaN) {
|
| 36 |
+
return 1; // step 4
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
if (yNaN) {
|
| 40 |
+
return -1; // step 5
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
if (x < y) {
|
| 44 |
+
return -1; // step 6
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
if (x > y) {
|
| 48 |
+
return 1; // step 7
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
if (SameValue(x, -0) && SameValue(y, 0)) {
|
| 52 |
+
return -1; // step 8
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
if (SameValue(x, 0) && SameValue(y, -0)) {
|
| 56 |
+
return 1; // step 9
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
return 0; // step 10
|
| 60 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CompletePropertyDescriptor.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var hasOwn = require('hasown');
|
| 6 |
+
|
| 7 |
+
var IsDataDescriptor = require('./IsDataDescriptor');
|
| 8 |
+
var IsGenericDescriptor = require('./IsGenericDescriptor');
|
| 9 |
+
|
| 10 |
+
var isPropertyDescriptor = require('../helpers/records/property-descriptor');
|
| 11 |
+
|
| 12 |
+
// https://262.ecma-international.org/6.0/#sec-completepropertydescriptor
|
| 13 |
+
|
| 14 |
+
module.exports = function CompletePropertyDescriptor(Desc) {
|
| 15 |
+
if (!isPropertyDescriptor(Desc)) {
|
| 16 |
+
throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor');
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
/* eslint no-param-reassign: 0 */
|
| 20 |
+
|
| 21 |
+
if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) {
|
| 22 |
+
if (!hasOwn(Desc, '[[Value]]')) {
|
| 23 |
+
Desc['[[Value]]'] = void 0;
|
| 24 |
+
}
|
| 25 |
+
if (!hasOwn(Desc, '[[Writable]]')) {
|
| 26 |
+
Desc['[[Writable]]'] = false;
|
| 27 |
+
}
|
| 28 |
+
} else {
|
| 29 |
+
if (!hasOwn(Desc, '[[Get]]')) {
|
| 30 |
+
Desc['[[Get]]'] = void 0;
|
| 31 |
+
}
|
| 32 |
+
if (!hasOwn(Desc, '[[Set]]')) {
|
| 33 |
+
Desc['[[Set]]'] = void 0;
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
if (!hasOwn(Desc, '[[Enumerable]]')) {
|
| 37 |
+
Desc['[[Enumerable]]'] = false;
|
| 38 |
+
}
|
| 39 |
+
if (!hasOwn(Desc, '[[Configurable]]')) {
|
| 40 |
+
Desc['[[Configurable]]'] = false;
|
| 41 |
+
}
|
| 42 |
+
return Desc;
|
| 43 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CompletionRecord.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $SyntaxError = require('es-errors/syntax');
|
| 4 |
+
|
| 5 |
+
var SLOT = require('internal-slot');
|
| 6 |
+
|
| 7 |
+
// https://262.ecma-international.org/7.0/#sec-completion-record-specification-type
|
| 8 |
+
|
| 9 |
+
var CompletionRecord = function CompletionRecord(type, value) {
|
| 10 |
+
if (!(this instanceof CompletionRecord)) {
|
| 11 |
+
return new CompletionRecord(type, value);
|
| 12 |
+
}
|
| 13 |
+
if (type !== 'normal' && type !== 'break' && type !== 'continue' && type !== 'return' && type !== 'throw') {
|
| 14 |
+
throw new $SyntaxError('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');
|
| 15 |
+
}
|
| 16 |
+
SLOT.set(this, '[[Type]]', type);
|
| 17 |
+
SLOT.set(this, '[[Value]]', value);
|
| 18 |
+
// [[Target]] slot?
|
| 19 |
+
};
|
| 20 |
+
|
| 21 |
+
CompletionRecord.prototype.type = function Type() {
|
| 22 |
+
return SLOT.get(this, '[[Type]]');
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
CompletionRecord.prototype.value = function Value() {
|
| 26 |
+
return SLOT.get(this, '[[Value]]');
|
| 27 |
+
};
|
| 28 |
+
|
| 29 |
+
CompletionRecord.prototype['?'] = function ReturnIfAbrupt() {
|
| 30 |
+
var type = SLOT.get(this, '[[Type]]');
|
| 31 |
+
var value = SLOT.get(this, '[[Value]]');
|
| 32 |
+
|
| 33 |
+
if (type === 'throw') {
|
| 34 |
+
throw value;
|
| 35 |
+
}
|
| 36 |
+
return value;
|
| 37 |
+
};
|
| 38 |
+
|
| 39 |
+
CompletionRecord.prototype['!'] = function assert() {
|
| 40 |
+
var type = SLOT.get(this, '[[Type]]');
|
| 41 |
+
|
| 42 |
+
if (type !== 'normal') {
|
| 43 |
+
throw new $SyntaxError('Assertion failed: Completion Record is not of type "normal"');
|
| 44 |
+
}
|
| 45 |
+
return SLOT.get(this, '[[Value]]');
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
module.exports = CompletionRecord;
|
tools/ui/node_modules/es-abstract/2024/CopyDataProperties.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
var isObject = require('es-object-atoms/isObject');
|
| 5 |
+
var callBound = require('call-bound');
|
| 6 |
+
var OwnPropertyKeys = require('own-keys');
|
| 7 |
+
|
| 8 |
+
var forEach = require('../helpers/forEach');
|
| 9 |
+
var every = require('../helpers/every');
|
| 10 |
+
var some = require('../helpers/some');
|
| 11 |
+
|
| 12 |
+
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
| 13 |
+
|
| 14 |
+
var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow');
|
| 15 |
+
var Get = require('./Get');
|
| 16 |
+
var IsArray = require('./IsArray');
|
| 17 |
+
var isPropertyKey = require('../helpers/isPropertyKey');
|
| 18 |
+
var SameValue = require('./SameValue');
|
| 19 |
+
var ToNumber = require('./ToNumber');
|
| 20 |
+
var ToObject = require('./ToObject');
|
| 21 |
+
|
| 22 |
+
var isInteger = require('math-intrinsics/isInteger');
|
| 23 |
+
|
| 24 |
+
// https://262.ecma-international.org/12.0/#sec-copydataproperties
|
| 25 |
+
|
| 26 |
+
module.exports = function CopyDataProperties(target, source, excludedItems) {
|
| 27 |
+
if (!isObject(target)) {
|
| 28 |
+
throw new $TypeError('Assertion failed: "target" must be an Object');
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!IsArray(excludedItems) || !every(excludedItems, isPropertyKey)) {
|
| 32 |
+
throw new $TypeError('Assertion failed: "excludedItems" must be a List of Property Keys');
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
if (typeof source === 'undefined' || source === null) {
|
| 36 |
+
return target;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
var from = ToObject(source);
|
| 40 |
+
|
| 41 |
+
var keys = OwnPropertyKeys(from);
|
| 42 |
+
forEach(keys, function (nextKey) {
|
| 43 |
+
var excluded = some(excludedItems, function (e) {
|
| 44 |
+
return SameValue(e, nextKey) === true;
|
| 45 |
+
});
|
| 46 |
+
/*
|
| 47 |
+
var excluded = false;
|
| 48 |
+
|
| 49 |
+
forEach(excludedItems, function (e) {
|
| 50 |
+
if (SameValue(e, nextKey) === true) {
|
| 51 |
+
excluded = true;
|
| 52 |
+
}
|
| 53 |
+
});
|
| 54 |
+
*/
|
| 55 |
+
|
| 56 |
+
var enumerable = $isEnumerable(from, nextKey) || (
|
| 57 |
+
// this is to handle string keys being non-enumerable in older engines
|
| 58 |
+
typeof source === 'string'
|
| 59 |
+
&& nextKey >= 0
|
| 60 |
+
&& isInteger(ToNumber(nextKey))
|
| 61 |
+
);
|
| 62 |
+
if (excluded === false && enumerable) {
|
| 63 |
+
var propValue = Get(from, nextKey);
|
| 64 |
+
CreateDataPropertyOrThrow(target, nextKey, propValue);
|
| 65 |
+
}
|
| 66 |
+
});
|
| 67 |
+
|
| 68 |
+
return target;
|
| 69 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CreateAsyncFromSyncIterator.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var GetIntrinsic = require('get-intrinsic');
|
| 4 |
+
|
| 5 |
+
var $SyntaxError = require('es-errors/syntax');
|
| 6 |
+
var $TypeError = require('es-errors/type');
|
| 7 |
+
var isObject = require('es-object-atoms/isObject');
|
| 8 |
+
var $Promise = GetIntrinsic('%Promise%', true);
|
| 9 |
+
|
| 10 |
+
var AsyncFromSyncIteratorContinuation = require('./AsyncFromSyncIteratorContinuation');
|
| 11 |
+
var Call = require('./Call');
|
| 12 |
+
var CreateIterResultObject = require('./CreateIterResultObject');
|
| 13 |
+
var Get = require('./Get');
|
| 14 |
+
var GetMethod = require('./GetMethod');
|
| 15 |
+
var IteratorNext = require('./IteratorNext');
|
| 16 |
+
var OrdinaryObjectCreate = require('./OrdinaryObjectCreate');
|
| 17 |
+
|
| 18 |
+
var isIteratorRecord = require('../helpers/records/iterator-record');
|
| 19 |
+
|
| 20 |
+
var SLOT = require('internal-slot');
|
| 21 |
+
|
| 22 |
+
var $AsyncFromSyncIteratorPrototype = GetIntrinsic('%AsyncFromSyncIteratorPrototype%', true) || {
|
| 23 |
+
next: function next(value) {
|
| 24 |
+
if (!$Promise) {
|
| 25 |
+
throw new $SyntaxError('This environment does not support Promises.');
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
var O = this; // step 1
|
| 29 |
+
|
| 30 |
+
SLOT.assert(O, '[[SyncIteratorRecord]]'); // step 2
|
| 31 |
+
|
| 32 |
+
var argsLength = arguments.length;
|
| 33 |
+
|
| 34 |
+
return new $Promise(function (resolve) { // step 3
|
| 35 |
+
var syncIteratorRecord = SLOT.get(O, '[[SyncIteratorRecord]]'); // step 4
|
| 36 |
+
var result;
|
| 37 |
+
if (argsLength > 0) {
|
| 38 |
+
result = IteratorNext(syncIteratorRecord, value); // step 5.a
|
| 39 |
+
} else { // step 6
|
| 40 |
+
result = IteratorNext(syncIteratorRecord);// step 6.a
|
| 41 |
+
}
|
| 42 |
+
resolve(AsyncFromSyncIteratorContinuation(result)); // step 8
|
| 43 |
+
});
|
| 44 |
+
},
|
| 45 |
+
'return': function () {
|
| 46 |
+
if (!$Promise) {
|
| 47 |
+
throw new $SyntaxError('This environment does not support Promises.');
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
var O = this; // step 1
|
| 51 |
+
|
| 52 |
+
SLOT.assert(O, '[[SyncIteratorRecord]]'); // step 2
|
| 53 |
+
|
| 54 |
+
var valueIsPresent = arguments.length > 0;
|
| 55 |
+
var value = valueIsPresent ? arguments[0] : void undefined;
|
| 56 |
+
|
| 57 |
+
return new $Promise(function (resolve, reject) { // step 3
|
| 58 |
+
var syncIterator = SLOT.get(O, '[[SyncIteratorRecord]]')['[[Iterator]]']; // step 4
|
| 59 |
+
var iteratorReturn = GetMethod(syncIterator, 'return'); // step 5
|
| 60 |
+
|
| 61 |
+
if (typeof iteratorReturn === 'undefined') { // step 7
|
| 62 |
+
var iterResult = CreateIterResultObject(value, true); // step 7.a
|
| 63 |
+
Call(resolve, void undefined, [iterResult]); // step 7.b
|
| 64 |
+
return;
|
| 65 |
+
}
|
| 66 |
+
var result;
|
| 67 |
+
if (valueIsPresent) { // step 8
|
| 68 |
+
result = Call(iteratorReturn, syncIterator, [value]); // step 8.a
|
| 69 |
+
} else { // step 9
|
| 70 |
+
result = Call(iteratorReturn, syncIterator); // step 9.a
|
| 71 |
+
}
|
| 72 |
+
if (!isObject(result)) { // step 11
|
| 73 |
+
Call(reject, void undefined, [new $TypeError('Iterator `return` method returned a non-object value.')]); // step 11.a
|
| 74 |
+
return;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
resolve(AsyncFromSyncIteratorContinuation(result)); // step 12
|
| 78 |
+
});
|
| 79 |
+
},
|
| 80 |
+
'throw': function () {
|
| 81 |
+
if (!$Promise) {
|
| 82 |
+
throw new $SyntaxError('This environment does not support Promises.');
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
var O = this; // step 1
|
| 86 |
+
|
| 87 |
+
SLOT.assert(O, '[[SyncIteratorRecord]]'); // step 2
|
| 88 |
+
|
| 89 |
+
var valueIsPresent = arguments.length > 0;
|
| 90 |
+
var value = valueIsPresent ? arguments[0] : void undefined;
|
| 91 |
+
|
| 92 |
+
return new $Promise(function (resolve, reject) { // step 3
|
| 93 |
+
var syncIterator = SLOT.get(O, '[[SyncIteratorRecord]]')['[[Iterator]]']; // step 4
|
| 94 |
+
|
| 95 |
+
var throwMethod = GetMethod(syncIterator, 'throw'); // step 5
|
| 96 |
+
|
| 97 |
+
if (typeof throwMethod === 'undefined') { // step 7
|
| 98 |
+
Call(reject, void undefined, [value]); // step 7.a
|
| 99 |
+
return;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
var result;
|
| 103 |
+
if (valueIsPresent) { // step 8
|
| 104 |
+
result = Call(throwMethod, syncIterator, [value]); // step 8.a
|
| 105 |
+
} else { // step 9
|
| 106 |
+
result = Call(throwMethod, syncIterator); // step 9.a
|
| 107 |
+
}
|
| 108 |
+
if (!isObject(result)) { // step 11
|
| 109 |
+
Call(reject, void undefined, [new $TypeError('Iterator `throw` method returned a non-object value.')]); // step 11.a
|
| 110 |
+
return;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
resolve(AsyncFromSyncIteratorContinuation(result/* , promiseCapability */)); // step 12
|
| 114 |
+
});
|
| 115 |
+
}
|
| 116 |
+
};
|
| 117 |
+
|
| 118 |
+
// https://262.ecma-international.org/15.0/#sec-createasyncfromsynciterator
|
| 119 |
+
|
| 120 |
+
module.exports = function CreateAsyncFromSyncIterator(syncIteratorRecord) {
|
| 121 |
+
if (!isIteratorRecord(syncIteratorRecord)) {
|
| 122 |
+
throw new $TypeError('Assertion failed: `syncIteratorRecord` must be an Iterator Record');
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
// var asyncIterator = OrdinaryObjectCreate(%AsyncFromSyncIteratorPrototype%, « [[SyncIteratorRecord]] »); // step 1
|
| 126 |
+
var asyncIterator = OrdinaryObjectCreate($AsyncFromSyncIteratorPrototype);
|
| 127 |
+
|
| 128 |
+
SLOT.set(asyncIterator, '[[SyncIteratorRecord]]', syncIteratorRecord); // step 2
|
| 129 |
+
|
| 130 |
+
var nextMethod = Get(asyncIterator, 'next'); // step 3
|
| 131 |
+
|
| 132 |
+
return { // steps 3-4
|
| 133 |
+
'[[Iterator]]': asyncIterator,
|
| 134 |
+
'[[NextMethod]]': nextMethod,
|
| 135 |
+
'[[Done]]': false
|
| 136 |
+
};
|
| 137 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CreateDataProperty.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
var isObject = require('es-object-atoms/isObject');
|
| 5 |
+
|
| 6 |
+
var isPropertyKey = require('../helpers/isPropertyKey');
|
| 7 |
+
var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty');
|
| 8 |
+
|
| 9 |
+
// https://262.ecma-international.org/6.0/#sec-createdataproperty
|
| 10 |
+
|
| 11 |
+
module.exports = function CreateDataProperty(O, P, V) {
|
| 12 |
+
if (!isObject(O)) {
|
| 13 |
+
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
| 14 |
+
}
|
| 15 |
+
if (!isPropertyKey(P)) {
|
| 16 |
+
throw new $TypeError('Assertion failed: P is not a Property Key');
|
| 17 |
+
}
|
| 18 |
+
var newDesc = {
|
| 19 |
+
'[[Configurable]]': true,
|
| 20 |
+
'[[Enumerable]]': true,
|
| 21 |
+
'[[Value]]': V,
|
| 22 |
+
'[[Writable]]': true
|
| 23 |
+
};
|
| 24 |
+
return OrdinaryDefineOwnProperty(O, P, newDesc);
|
| 25 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CreateDataPropertyOrThrow.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
var isObject = require('es-object-atoms/isObject');
|
| 5 |
+
|
| 6 |
+
var CreateDataProperty = require('./CreateDataProperty');
|
| 7 |
+
|
| 8 |
+
var isPropertyKey = require('../helpers/isPropertyKey');
|
| 9 |
+
|
| 10 |
+
// // https://262.ecma-international.org/14.0/#sec-createdatapropertyorthrow
|
| 11 |
+
|
| 12 |
+
module.exports = function CreateDataPropertyOrThrow(O, P, V) {
|
| 13 |
+
if (!isObject(O)) {
|
| 14 |
+
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
| 15 |
+
}
|
| 16 |
+
if (!isPropertyKey(P)) {
|
| 17 |
+
throw new $TypeError('Assertion failed: P is not a Property Key');
|
| 18 |
+
}
|
| 19 |
+
var success = CreateDataProperty(O, P, V);
|
| 20 |
+
if (!success) {
|
| 21 |
+
throw new $TypeError('unable to create data property');
|
| 22 |
+
}
|
| 23 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CreateHTML.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
var callBound = require('call-bound');
|
| 6 |
+
|
| 7 |
+
var $replace = callBound('String.prototype.replace');
|
| 8 |
+
|
| 9 |
+
var RequireObjectCoercible = require('./RequireObjectCoercible');
|
| 10 |
+
var ToString = require('./ToString');
|
| 11 |
+
|
| 12 |
+
// https://262.ecma-international.org/6.0/#sec-createhtml
|
| 13 |
+
|
| 14 |
+
module.exports = function CreateHTML(string, tag, attribute, value) {
|
| 15 |
+
if (typeof tag !== 'string' || typeof attribute !== 'string') {
|
| 16 |
+
throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings');
|
| 17 |
+
}
|
| 18 |
+
var str = RequireObjectCoercible(string);
|
| 19 |
+
var S = ToString(str);
|
| 20 |
+
var p1 = '<' + tag;
|
| 21 |
+
if (attribute !== '') {
|
| 22 |
+
var V = ToString(value);
|
| 23 |
+
var escapedV = $replace(V, /\x22/g, '"');
|
| 24 |
+
p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22';
|
| 25 |
+
}
|
| 26 |
+
return p1 + '>' + S + '</' + tag + '>';
|
| 27 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CreateIterResultObject.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $TypeError = require('es-errors/type');
|
| 4 |
+
|
| 5 |
+
// https://262.ecma-international.org/6.0/#sec-createiterresultobject
|
| 6 |
+
|
| 7 |
+
module.exports = function CreateIterResultObject(value, done) {
|
| 8 |
+
if (typeof done !== 'boolean') {
|
| 9 |
+
throw new $TypeError('Assertion failed: Type(done) is not Boolean');
|
| 10 |
+
}
|
| 11 |
+
return {
|
| 12 |
+
value: value,
|
| 13 |
+
done: done
|
| 14 |
+
};
|
| 15 |
+
};
|
tools/ui/node_modules/es-abstract/2024/CreateListFromArrayLike.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var callBound = require('call-bound');
|
| 4 |
+
|
| 5 |
+
var $TypeError = require('es-errors/type');
|
| 6 |
+
var isObject = require('es-object-atoms/isObject');
|
| 7 |
+
var $indexOf = callBound('Array.prototype.indexOf', true) || callBound('String.prototype.indexOf');
|
| 8 |
+
|
| 9 |
+
var Get = require('./Get');
|
| 10 |
+
var IsArray = require('./IsArray');
|
| 11 |
+
var LengthOfArrayLike = require('./LengthOfArrayLike');
|
| 12 |
+
var ToString = require('./ToString');
|
| 13 |
+
var Type = require('./Type');
|
| 14 |
+
|
| 15 |
+
var defaultElementTypes = ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'BigInt', 'Object'];
|
| 16 |
+
|
| 17 |
+
// https://262.ecma-international.org/11.0/#sec-createlistfromarraylike
|
| 18 |
+
|
| 19 |
+
module.exports = function CreateListFromArrayLike(obj) {
|
| 20 |
+
var elementTypes = arguments.length > 1
|
| 21 |
+
? arguments[1]
|
| 22 |
+
: defaultElementTypes;
|
| 23 |
+
|
| 24 |
+
if (!isObject(obj)) {
|
| 25 |
+
throw new $TypeError('Assertion failed: `obj` must be an Object');
|
| 26 |
+
}
|
| 27 |
+
if (!IsArray(elementTypes)) {
|
| 28 |
+
throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array');
|
| 29 |
+
}
|
| 30 |
+
var len = LengthOfArrayLike(obj);
|
| 31 |
+
var list = [];
|
| 32 |
+
var index = 0;
|
| 33 |
+
while (index < len) {
|
| 34 |
+
var indexName = ToString(index);
|
| 35 |
+
var next = Get(obj, indexName);
|
| 36 |
+
var nextType = Type(next);
|
| 37 |
+
if ($indexOf(elementTypes, nextType) < 0) {
|
| 38 |
+
throw new $TypeError('item type ' + nextType + ' is not a valid elementType');
|
| 39 |
+
}
|
| 40 |
+
list[list.length] = next;
|
| 41 |
+
index += 1;
|
| 42 |
+
}
|
| 43 |
+
return list;
|
| 44 |
+
};
|