Skip to content

Commit caf930b

Browse files
committed
Remove unused operation from polyfill
1 parent 0835da5 commit caf930b

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

lib/ecmascript.mjs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* global __debug__ */
22

3-
const ArrayIsArray = Array.isArray;
4-
const ArrayPrototypeIndexOf = Array.prototype.indexOf;
53
const ArrayPrototypePush = Array.prototype.push;
64
const IntlDateTimeFormat = globalThis.Intl.DateTimeFormat;
75
const MathMin = Math.min;
@@ -4342,36 +4340,6 @@ export const ES = ObjectAssign({}, ES2020, {
43424340
throw new RangeError(`${property} must be between ${minimum} and ${maximum}, not ${value}`);
43434341
}
43444342
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;
43754343
}
43764344
});
43774345

0 commit comments

Comments
 (0)