Skip to content

Commit ebf97cc

Browse files
committed
drop unneeded non-standard %TypedArray%.prototype.toSpliced feature detection
1 parent f37b548 commit ebf97cc

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

packages/core-js/modules/esnext.typed-array.to-spliced.js

+1-17
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,13 @@ var isBigIntArray = require('../internals/is-big-int-array');
66
var toAbsoluteIndex = require('../internals/to-absolute-index');
77
var toBigInt = require('../internals/to-big-int');
88
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
9-
var fails = require('../internals/fails');
109

1110
var aTypedArray = ArrayBufferViewCore.aTypedArray;
1211
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
1312
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
1413
var max = Math.max;
1514
var min = Math.min;
1615

17-
// some early implementations, like WebKit, does not follow the final semantic
18-
var PROPER_ORDER = !fails(function () {
19-
// eslint-disable-next-line es/no-typed-arrays -- required for testing
20-
var array = new Int8Array([1]);
21-
22-
var spliced = array.toSpliced(1, 0, {
23-
valueOf: function () {
24-
array[0] = 2;
25-
return 3;
26-
}
27-
});
28-
29-
return spliced[0] !== 2 || spliced[1] !== 3;
30-
});
31-
3216
// `%TypedArray%.prototype.toSpliced` method
3317
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSpliced
3418
exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , ...items */) {
@@ -65,4 +49,4 @@ exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , .
6549
for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount];
6650

6751
return A;
68-
}, !PROPER_ORDER);
52+
}, true);

0 commit comments

Comments
 (0)