From ebf97cc62c2a8d3549e5f03558ae8c47ddb9cac1 Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Thu, 21 Nov 2024 11:17:16 +0700 Subject: [PATCH] drop unneeded non-standard `%TypedArray%.prototype.toSpliced` feature detection --- .../modules/esnext.typed-array.to-spliced.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/packages/core-js/modules/esnext.typed-array.to-spliced.js b/packages/core-js/modules/esnext.typed-array.to-spliced.js index 9ed5450dd1db..710f29646611 100644 --- a/packages/core-js/modules/esnext.typed-array.to-spliced.js +++ b/packages/core-js/modules/esnext.typed-array.to-spliced.js @@ -6,7 +6,6 @@ var isBigIntArray = require('../internals/is-big-int-array'); var toAbsoluteIndex = require('../internals/to-absolute-index'); var toBigInt = require('../internals/to-big-int'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); -var fails = require('../internals/fails'); var aTypedArray = ArrayBufferViewCore.aTypedArray; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; @@ -14,21 +13,6 @@ var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var max = Math.max; var min = Math.min; -// some early implementations, like WebKit, does not follow the final semantic -var PROPER_ORDER = !fails(function () { - // eslint-disable-next-line es/no-typed-arrays -- required for testing - var array = new Int8Array([1]); - - var spliced = array.toSpliced(1, 0, { - valueOf: function () { - array[0] = 2; - return 3; - } - }); - - return spliced[0] !== 2 || spliced[1] !== 3; -}); - // `%TypedArray%.prototype.toSpliced` method // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSpliced exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , ...items */) { @@ -65,4 +49,4 @@ exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , . for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount]; return A; -}, !PROPER_ORDER); +}, true);