|
1 | 1 | /* global __debug__ */
|
2 | 2 |
|
3 |
| -const ArrayIsArray = Array.isArray; |
4 |
| -const ArrayPrototypeIndexOf = Array.prototype.indexOf; |
5 | 3 | const ArrayPrototypePush = Array.prototype.push;
|
6 | 4 | const IntlDateTimeFormat = globalThis.Intl.DateTimeFormat;
|
7 | 5 | const MathMin = Math.min;
|
@@ -4342,36 +4340,6 @@ export const ES = ObjectAssign({}, ES2020, {
|
4342 | 4340 | throw new RangeError(`${property} must be between ${minimum} and ${maximum}, not ${value}`);
|
4343 | 4341 | }
|
4344 | 4342 | return MathFloor(value);
|
4345 |
| - }, |
4346 |
| - // Following two operations are overridden because the es-abstract version of |
4347 |
| - // ES.Get() unconditionally uses util.inspect |
4348 |
| - LengthOfArrayLike: (obj) => { |
4349 |
| - if (ES.Type(obj) !== 'Object') { |
4350 |
| - throw new TypeError('Assertion failed: `obj` must be an Object'); |
4351 |
| - } |
4352 |
| - return ES.ToLength(obj.length); |
4353 |
| - }, |
4354 |
| - CreateListFromArrayLike: (obj, elementTypes) => { |
4355 |
| - if (ES.Type(obj) !== 'Object') { |
4356 |
| - throw new TypeError('Assertion failed: `obj` must be an Object'); |
4357 |
| - } |
4358 |
| - if (!ArrayIsArray(elementTypes)) { |
4359 |
| - throw new TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); |
4360 |
| - } |
4361 |
| - var len = ES.LengthOfArrayLike(obj); |
4362 |
| - var list = []; |
4363 |
| - var index = 0; |
4364 |
| - while (index < len) { |
4365 |
| - var indexName = ES.ToString(index); |
4366 |
| - var next = obj[indexName]; |
4367 |
| - var nextType = ES.Type(next); |
4368 |
| - if (ArrayPrototypeIndexOf.call(elementTypes, nextType) < 0) { |
4369 |
| - throw new TypeError(`item type ${nextType} is not a valid elementType`); |
4370 |
| - } |
4371 |
| - ArrayPrototypePush.call(list, next); |
4372 |
| - index += 1; |
4373 |
| - } |
4374 |
| - return list; |
4375 | 4343 | }
|
4376 | 4344 | });
|
4377 | 4345 |
|
|
0 commit comments