Comparing version 3.23.2 to 3.23.3
@@ -15,4 +15,6 @@ var isCallable = require('../internals/is-callable'); | ||
} else { | ||
if (!options.unsafe) delete O[key]; | ||
else if (O[key]) simple = true; | ||
try { | ||
if (!options.unsafe) delete O[key]; | ||
else if (O[key]) simple = true; | ||
} catch (error) { /* empty */ } | ||
if (simple) O[key] = value; | ||
@@ -19,0 +21,0 @@ else definePropertyModule.f(O, key, { |
@@ -27,3 +27,4 @@ var fails = require('../internals/fails'); | ||
if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { | ||
defineProperty(value, 'name', { value: name, configurable: true }); | ||
if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); | ||
else value.name = name; | ||
} | ||
@@ -30,0 +31,0 @@ if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { |
@@ -7,7 +7,7 @@ var IS_PURE = require('../internals/is-pure'); | ||
})('versions', []).push({ | ||
version: '3.23.2', | ||
version: '3.23.3', | ||
mode: IS_PURE ? 'pure' : 'global', | ||
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)', | ||
license: 'https://github.com/zloirock/core-js/blob/v3.23.2/LICENSE', | ||
license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE', | ||
source: 'https://github.com/zloirock/core-js' | ||
}); |
'use strict'; | ||
var $ = require('../internals/export'); | ||
var addToUnscopables = require('../internals/add-to-unscopables'); | ||
var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer'); | ||
var lengthOfArrayLike = require('../internals/length-of-array-like'); | ||
var toAbsoluteIndex = require('../internals/to-absolute-index'); | ||
var toIndexedObject = require('../internals/to-indexed-object'); | ||
var arraySlice = require('../internals/array-slice'); | ||
var arrayToSpliced = require('../internals/array-to-spliced'); | ||
var addToUnscopables = require('../internals/add-to-unscopables'); | ||
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); | ||
var $Array = Array; | ||
var max = Math.max; | ||
var min = Math.min; | ||
// `Array.prototype.toSpliced` method | ||
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSpliced | ||
$({ target: 'Array', proto: true, arity: 2 }, { | ||
// eslint-disable-next-line no-unused-vars -- required for .length | ||
$({ target: 'Array', proto: true }, { | ||
toSpliced: function toSpliced(start, deleteCount /* , ...items */) { | ||
return arrayToSpliced(toIndexedObject(this), $Array, arraySlice(arguments)); | ||
var O = toIndexedObject(this); | ||
var len = lengthOfArrayLike(O); | ||
var actualStart = toAbsoluteIndex(start, len); | ||
var argumentsLength = arguments.length; | ||
var k = 0; | ||
var insertCount, actualDeleteCount, newLen, A; | ||
if (argumentsLength === 0) { | ||
insertCount = actualDeleteCount = 0; | ||
} else if (argumentsLength === 1) { | ||
insertCount = 0; | ||
actualDeleteCount = len - actualStart; | ||
} else { | ||
insertCount = argumentsLength - 2; | ||
actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); | ||
} | ||
newLen = doesNotExceedSafeInteger(len + insertCount - actualDeleteCount); | ||
A = $Array(newLen); | ||
for (; k < actualStart; k++) A[k] = O[k]; | ||
for (; k < actualStart + insertCount; k++) A[k] = arguments[k - actualStart + 2]; | ||
for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount]; | ||
return A; | ||
} | ||
@@ -17,0 +42,0 @@ }); |
'use strict'; | ||
var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); | ||
var arraySlice = require('../internals/array-slice'); | ||
var arrayToSpliced = require('../internals/array-to-spliced'); | ||
var lengthOfArrayLike = require('../internals/length-of-array-like'); | ||
var toAbsoluteIndex = require('../internals/to-absolute-index'); | ||
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); | ||
var fails = require('../internals/fails'); | ||
@@ -9,8 +11,53 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray; | ||
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-x/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 | ||
// eslint-disable-next-line no-unused-vars -- required for .length | ||
exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , ...items */) { | ||
return arrayToSpliced(aTypedArray(this), getTypedArrayConstructor(this), arraySlice(arguments)); | ||
}, { arity: 2 }); | ||
var O = aTypedArray(this); | ||
var C = getTypedArrayConstructor(O); | ||
var len = lengthOfArrayLike(O); | ||
var actualStart = toAbsoluteIndex(start, len); | ||
var argumentsLength = arguments.length; | ||
var k = 0; | ||
var insertCount, actualDeleteCount, convertedItems, newLen, A; | ||
if (argumentsLength === 0) { | ||
insertCount = actualDeleteCount = 0; | ||
} else if (argumentsLength === 1) { | ||
insertCount = 0; | ||
actualDeleteCount = len - actualStart; | ||
} else { | ||
actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); | ||
insertCount = argumentsLength - 2; | ||
if (insertCount) { | ||
convertedItems = new C(insertCount); | ||
for (var i = 2; i < argumentsLength; i++) { | ||
convertedItems[i - 2] = arguments[i]; | ||
} | ||
} | ||
} | ||
newLen = len + insertCount - actualDeleteCount; | ||
A = new C(newLen); | ||
for (; k < actualStart; k++) A[k] = O[k]; | ||
for (; k < actualStart + insertCount; k++) A[k] = convertedItems[k - actualStart]; | ||
for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount]; | ||
return A; | ||
}, !PROPER_ORDER); |
'use strict'; | ||
var arrayWith = require('../internals/array-with'); | ||
var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); | ||
var isBigIntArray = require('../internals/is-big-int-array'); | ||
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); | ||
var toBigInt = require('../internals/to-big-int'); | ||
var classof = require('../internals/classof'); | ||
var uncurryThis = require('../internals/function-uncurry-this'); | ||
@@ -12,3 +11,2 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray; | ||
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; | ||
var slice = uncurryThis(''.slice); | ||
@@ -29,6 +27,6 @@ var PROPER_ORDER = !!function () { | ||
exportTypedArrayMethod('with', { 'with': function (index, value) { | ||
aTypedArray(this); | ||
var O = aTypedArray(this); | ||
var relativeIndex = toIntegerOrInfinity(index); | ||
var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value; | ||
return arrayWith(this, getTypedArrayConstructor(this), relativeIndex, actualValue); | ||
var actualValue = isBigIntArray(O) ? toBigInt(value) : +value; | ||
return arrayWith(O, getTypedArrayConstructor(O), relativeIndex, actualValue); | ||
} }['with'], !PROPER_ORDER); |
{ | ||
"name": "core-js", | ||
"description": "Standard library", | ||
"version": "3.23.2", | ||
"version": "3.23.3", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
1003266
23221
0