core-js 3.22.8 → 3.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/actual/array/find-last-index.js +2 -2
- package/actual/array/find-last.js +2 -2
- package/actual/array/group-to-map.js +6 -0
- package/actual/array/group.js +4 -0
- package/actual/array/index.js +2 -0
- package/actual/array/push.js +3 -0
- package/actual/array/unshift.js +3 -0
- package/actual/array/virtual/find-last-index.js +2 -2
- package/actual/array/virtual/find-last.js +2 -2
- package/actual/array/virtual/group-to-map.js +6 -0
- package/actual/array/virtual/group.js +4 -0
- package/actual/array/virtual/index.js +2 -0
- package/actual/array/virtual/push.js +3 -0
- package/actual/array/virtual/unshift.js +3 -0
- package/actual/instance/group-to-map.js +9 -0
- package/actual/instance/group.js +9 -0
- package/actual/instance/push.js +3 -0
- package/actual/instance/unshift.js +3 -0
- package/actual/typed-array/find-last-index.js +3 -0
- package/actual/typed-array/find-last.js +3 -0
- package/es/array/find-last-index.js +4 -0
- package/es/array/find-last.js +4 -0
- package/es/array/index.js +4 -0
- package/es/array/push.js +4 -0
- package/es/array/unshift.js +4 -0
- package/es/array/virtual/find-last-index.js +4 -0
- package/es/array/virtual/find-last.js +4 -0
- package/es/array/virtual/index.js +4 -0
- package/es/array/virtual/push.js +4 -0
- package/es/array/virtual/unshift.js +4 -0
- package/es/index.js +6 -0
- package/es/instance/find-last-index.js +9 -0
- package/es/instance/find-last.js +9 -0
- package/es/instance/push.js +9 -0
- package/es/instance/unshift.js +9 -0
- package/es/typed-array/find-last-index.js +1 -0
- package/es/typed-array/find-last.js +1 -0
- package/es/typed-array/methods.js +2 -0
- package/features/array/group-to-map.js +1 -0
- package/features/array/group.js +1 -0
- package/features/array/push.js +1 -0
- package/features/array/unshift.js +1 -0
- package/features/array/virtual/group-to-map.js +1 -0
- package/features/array/virtual/group.js +1 -0
- package/features/array/virtual/push.js +1 -0
- package/features/array/virtual/unshift.js +1 -0
- package/features/instance/group-to-map.js +1 -0
- package/features/instance/group.js +1 -0
- package/features/instance/push.js +1 -0
- package/features/instance/unshift.js +1 -0
- package/features/symbol/metadata-key.js +1 -0
- package/full/array/group-to-map.js +3 -0
- package/full/array/group.js +3 -0
- package/full/array/push.js +3 -0
- package/full/array/unshift.js +3 -0
- package/full/array/virtual/group-to-map.js +3 -0
- package/full/array/virtual/group.js +3 -0
- package/full/array/virtual/push.js +3 -0
- package/full/array/virtual/unshift.js +3 -0
- package/full/index.js +9 -0
- package/full/instance/group-to-map.js +3 -0
- package/full/instance/group.js +3 -0
- package/full/instance/push.js +3 -0
- package/full/instance/unshift.js +3 -0
- package/full/symbol/index.js +2 -2
- package/full/symbol/metadata-key.js +4 -0
- package/internals/array-buffer-view-core.js +14 -4
- package/internals/array-group-to-map.js +32 -0
- package/internals/{array-group-by.js → array-group.js} +0 -0
- package/internals/define-built-in.js +7 -2
- package/internals/engine-is-deno.js +2 -0
- package/internals/regexp-flags.js +1 -0
- package/internals/shared.js +2 -2
- package/internals/typed-array-constructor.js +2 -2
- package/internals/typed-array-species-constructor.js +2 -2
- package/modules/es.array.find-last-index.js +14 -0
- package/modules/es.array.find-last.js +14 -0
- package/modules/es.array.push.js +39 -0
- package/modules/es.array.unshift.js +42 -0
- package/modules/es.number.epsilon.js +1 -1
- package/modules/es.number.max-safe-integer.js +1 -1
- package/modules/es.number.min-safe-integer.js +1 -1
- package/modules/es.regexp.flags.js +38 -1
- package/modules/es.typed-array.find-last-index.js +12 -0
- package/modules/es.typed-array.find-last.js +12 -0
- package/modules/esnext.array.find-last-index.js +2 -14
- package/modules/esnext.array.find-last.js +2 -14
- package/modules/esnext.array.group-by-to-map.js +4 -30
- package/modules/esnext.array.group-by.js +3 -2
- package/modules/esnext.array.group-to-map.js +11 -0
- package/modules/esnext.array.group.js +15 -0
- package/modules/esnext.math.deg-per-rad.js +1 -1
- package/modules/esnext.math.rad-per-deg.js +1 -1
- package/modules/esnext.symbol.metadata-key.js +5 -0
- package/modules/esnext.symbol.metadata.js +1 -0
- package/modules/esnext.typed-array.find-last-index.js +2 -12
- package/modules/esnext.typed-array.find-last.js +2 -12
- package/modules/esnext.typed-array.group-by.js +2 -2
- package/modules/esnext.typed-array.to-reversed.js +2 -2
- package/modules/esnext.typed-array.to-sorted.js +2 -2
- package/modules/esnext.typed-array.to-spliced.js +2 -2
- package/modules/esnext.typed-array.with.js +22 -12
- package/modules/web.structured-clone.js +17 -5
- package/package.json +1 -1
- package/proposals/array-grouping-stage-3-2.js +3 -0
- package/proposals/array-grouping-stage-3.js +1 -0
- package/proposals/decorator-metadata.js +2 -0
- package/proposals/decorators.js +1 -2
- package/stable/array/find-last-index.js +1 -0
- package/stable/array/find-last.js +1 -0
- package/stable/array/push.js +3 -0
- package/stable/array/unshift.js +3 -0
- package/stable/array/virtual/find-last-index.js +1 -0
- package/stable/array/virtual/find-last.js +1 -0
- package/stable/array/virtual/push.js +3 -0
- package/stable/array/virtual/unshift.js +3 -0
- package/stable/index.js +6 -0
- package/stable/instance/find-last-index.js +3 -0
- package/stable/instance/find-last.js +3 -0
- package/stable/instance/push.js +3 -0
- package/stable/instance/unshift.js +3 -0
- package/stable/typed-array/find-last-index.js +1 -0
- package/stable/typed-array/find-last.js +1 -0
- package/stage/2.js +2 -1
- package/stage/3.js +3 -1
|
@@ -5,8 +5,8 @@ var aCallable = require('../internals/a-callable');
|
|
|
5
5
|
var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');
|
|
6
6
|
|
|
7
7
|
var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
8
|
+
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
|
|
8
9
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
9
|
-
var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
|
|
10
10
|
var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort);
|
|
11
11
|
|
|
12
12
|
// `%TypedArray%.prototype.toSorted` method
|
|
@@ -14,6 +14,6 @@ var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort);
|
|
|
14
14
|
exportTypedArrayMethod('toSorted', function toSorted(compareFn) {
|
|
15
15
|
if (compareFn !== undefined) aCallable(compareFn);
|
|
16
16
|
var O = aTypedArray(this);
|
|
17
|
-
var A = arrayFromConstructorAndList(O
|
|
17
|
+
var A = arrayFromConstructorAndList(getTypedArrayConstructor(O), O);
|
|
18
18
|
return sort(A, compareFn);
|
|
19
19
|
});
|
|
@@ -4,12 +4,12 @@ var arraySlice = require('../internals/array-slice');
|
|
|
4
4
|
var arrayToSpliced = require('../internals/array-to-spliced');
|
|
5
5
|
|
|
6
6
|
var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
7
|
+
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
|
|
7
8
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
8
|
-
var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
|
|
9
9
|
|
|
10
10
|
// `%TypedArray%.prototype.toSpliced` method
|
|
11
11
|
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSpliced
|
|
12
12
|
// eslint-disable-next-line no-unused-vars -- required for .length
|
|
13
13
|
exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , ...items */) {
|
|
14
|
-
return arrayToSpliced(aTypedArray(this), this
|
|
14
|
+
return arrayToSpliced(aTypedArray(this), getTypedArrayConstructor(this), arraySlice(arguments));
|
|
15
15
|
}, { arity: 2 });
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var arrayWith = require('../internals/array-with');
|
|
3
3
|
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
|
|
5
|
+
var toBigInt = require('../internals/to-big-int');
|
|
6
|
+
var classof = require('../internals/classof');
|
|
7
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
8
8
|
|
|
9
9
|
var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
|
10
|
+
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
|
|
10
11
|
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
|
11
|
-
var
|
|
12
|
-
|
|
12
|
+
var slice = uncurryThis(''.slice);
|
|
13
|
+
|
|
14
|
+
var PROPER_ORDER = !!function () {
|
|
15
|
+
try {
|
|
16
|
+
// eslint-disable-next-line no-throw-literal, es-x/no-typed-arrays -- required for testing
|
|
17
|
+
new Int8Array(1)['with'](2, { valueOf: function () { throw 8; } });
|
|
18
|
+
} catch (error) {
|
|
19
|
+
// some early implementations, like WebKit, does not follow the final semantic
|
|
20
|
+
// https://github.com/tc39/proposal-change-array-by-copy/pull/86
|
|
21
|
+
return error === 8;
|
|
22
|
+
}
|
|
23
|
+
}();
|
|
13
24
|
|
|
14
25
|
// `%TypedArray%.prototype.with` method
|
|
15
26
|
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with
|
|
16
27
|
exportTypedArrayMethod('with', { 'with': function (index, value) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} }['with']);
|
|
28
|
+
aTypedArray(this);
|
|
29
|
+
var relativeIndex = toIntegerOrInfinity(index);
|
|
30
|
+
var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;
|
|
31
|
+
return arrayWith(this, getTypedArrayConstructor(this), relativeIndex, actualValue);
|
|
32
|
+
} }['with'], !PROPER_ORDER);
|
|
@@ -19,6 +19,10 @@ var lengthOfArrayLike = require('../internals/length-of-array-like');
|
|
|
19
19
|
var validateArgumentsLength = require('../internals/validate-arguments-length');
|
|
20
20
|
var getRegExpFlags = require('../internals/regexp-get-flags');
|
|
21
21
|
var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');
|
|
22
|
+
var V8 = require('../internals/engine-v8-version');
|
|
23
|
+
var IS_BROWSER = require('../internals/engine-is-browser');
|
|
24
|
+
var IS_DENO = require('../internals/engine-is-deno');
|
|
25
|
+
var IS_NODE = require('../internals/engine-is-node');
|
|
22
26
|
|
|
23
27
|
var Object = global.Object;
|
|
24
28
|
var Date = global.Date;
|
|
@@ -61,11 +65,11 @@ var checkBasicSemantic = function (structuredCloneImplementation) {
|
|
|
61
65
|
}) && structuredCloneImplementation;
|
|
62
66
|
};
|
|
63
67
|
|
|
64
|
-
var checkErrorsCloning = function (structuredCloneImplementation) {
|
|
68
|
+
var checkErrorsCloning = function (structuredCloneImplementation, $Error) {
|
|
65
69
|
return !fails(function () {
|
|
66
|
-
var error = new Error();
|
|
70
|
+
var error = new $Error();
|
|
67
71
|
var test = structuredCloneImplementation({ a: error, b: error });
|
|
68
|
-
return !(test && test.a === test.b && test.a instanceof Error);
|
|
72
|
+
return !(test && test.a === test.b && test.a instanceof $Error);
|
|
69
73
|
});
|
|
70
74
|
};
|
|
71
75
|
|
|
@@ -80,12 +84,17 @@ var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) {
|
|
|
80
84
|
// FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+
|
|
81
85
|
// FF and Safari implementations can't clone errors
|
|
82
86
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1556604
|
|
83
|
-
// Chrome <
|
|
87
|
+
// Chrome <102 returns `null` if cloned object contains multiple references to one error
|
|
84
88
|
// https://bugs.chromium.org/p/v8/issues/detail?id=12542
|
|
89
|
+
// NodeJS implementation can't clone DOMExceptions
|
|
90
|
+
// https://github.com/nodejs/node/issues/41038
|
|
85
91
|
// no one of current implementations supports new (html/5749) error cloning semantic
|
|
86
92
|
var nativeStructuredClone = global.structuredClone;
|
|
87
93
|
|
|
88
|
-
var FORCED_REPLACEMENT = IS_PURE
|
|
94
|
+
var FORCED_REPLACEMENT = IS_PURE
|
|
95
|
+
|| !checkErrorsCloning(nativeStructuredClone, Error)
|
|
96
|
+
|| !checkErrorsCloning(nativeStructuredClone, DOMException)
|
|
97
|
+
|| !checkNewErrorsCloningSemantic(nativeStructuredClone);
|
|
89
98
|
|
|
90
99
|
// Chrome 82+, Safari 14.1+, Deno 1.11+
|
|
91
100
|
// Chrome 78-81 implementation swaps `.name` and `.message` of cloned `DOMException`
|
|
@@ -397,6 +406,9 @@ var structuredCloneInternal = function (value, map) {
|
|
|
397
406
|
};
|
|
398
407
|
|
|
399
408
|
var PROPER_TRANSFER = nativeStructuredClone && !fails(function () {
|
|
409
|
+
// prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation
|
|
410
|
+
// https://github.com/zloirock/core-js/issues/679
|
|
411
|
+
if ((IS_DENO && V8 > 92) || (IS_NODE && V8 > 94) || (IS_BROWSER && V8 > 97)) return false;
|
|
400
412
|
var buffer = new ArrayBuffer(8);
|
|
401
413
|
var clone = nativeStructuredClone(buffer, { transfer: [buffer] });
|
|
402
414
|
return buffer.byteLength != 0 || clone.byteLength != 8;
|
package/package.json
CHANGED
package/proposals/decorators.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// TODO:
|
|
2
|
-
// so required a new entry point for it when it will be finally formed
|
|
1
|
+
// TODO: Remove from `core-js@4`
|
|
3
2
|
// https://github.com/tc39/proposal-decorators
|
|
4
3
|
require('../modules/esnext.symbol.metadata');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../es/array/find-last-index');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../es/array/find-last');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../../es/array/virtual/find-last-index');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../../es/array/virtual/find-last');
|
package/stable/index.js
CHANGED
|
@@ -25,6 +25,8 @@ require('../modules/es.array.fill');
|
|
|
25
25
|
require('../modules/es.array.filter');
|
|
26
26
|
require('../modules/es.array.find');
|
|
27
27
|
require('../modules/es.array.find-index');
|
|
28
|
+
require('../modules/es.array.find-last');
|
|
29
|
+
require('../modules/es.array.find-last-index');
|
|
28
30
|
require('../modules/es.array.flat');
|
|
29
31
|
require('../modules/es.array.flat-map');
|
|
30
32
|
require('../modules/es.array.for-each');
|
|
@@ -37,6 +39,7 @@ require('../modules/es.array.join');
|
|
|
37
39
|
require('../modules/es.array.last-index-of');
|
|
38
40
|
require('../modules/es.array.map');
|
|
39
41
|
require('../modules/es.array.of');
|
|
42
|
+
require('../modules/es.array.push');
|
|
40
43
|
require('../modules/es.array.reduce');
|
|
41
44
|
require('../modules/es.array.reduce-right');
|
|
42
45
|
require('../modules/es.array.reverse');
|
|
@@ -47,6 +50,7 @@ require('../modules/es.array.species');
|
|
|
47
50
|
require('../modules/es.array.splice');
|
|
48
51
|
require('../modules/es.array.unscopables.flat');
|
|
49
52
|
require('../modules/es.array.unscopables.flat-map');
|
|
53
|
+
require('../modules/es.array.unshift');
|
|
50
54
|
require('../modules/es.array-buffer.constructor');
|
|
51
55
|
require('../modules/es.array-buffer.is-view');
|
|
52
56
|
require('../modules/es.array-buffer.slice');
|
|
@@ -202,6 +206,8 @@ require('../modules/es.typed-array.fill');
|
|
|
202
206
|
require('../modules/es.typed-array.filter');
|
|
203
207
|
require('../modules/es.typed-array.find');
|
|
204
208
|
require('../modules/es.typed-array.find-index');
|
|
209
|
+
require('../modules/es.typed-array.find-last');
|
|
210
|
+
require('../modules/es.typed-array.find-last-index');
|
|
205
211
|
require('../modules/es.typed-array.for-each');
|
|
206
212
|
require('../modules/es.typed-array.from');
|
|
207
213
|
require('../modules/es.typed-array.includes');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../es/typed-array/find-last-index');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../es/typed-array/find-last');
|
package/stage/2.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
require('../proposals/array-from-async-stage-2');
|
|
2
2
|
require('../proposals/array-is-template-object');
|
|
3
|
-
require('../proposals/
|
|
3
|
+
require('../proposals/decorator-metadata');
|
|
4
4
|
require('../proposals/iterator-helpers');
|
|
5
5
|
require('../proposals/map-upsert-stage-2');
|
|
6
6
|
require('../proposals/set-methods');
|
|
7
7
|
require('../proposals/using-statement');
|
|
8
8
|
// TODO: Obsolete versions, remove from `core-js@4`
|
|
9
9
|
require('../proposals/array-grouping');
|
|
10
|
+
require('../proposals/decorators');
|
|
10
11
|
var parent = require('./3');
|
|
11
12
|
|
|
12
13
|
module.exports = parent;
|
package/stage/3.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
require('../proposals/array-find-from-last');
|
|
2
|
-
require('../proposals/array-grouping-stage-3');
|
|
2
|
+
require('../proposals/array-grouping-stage-3-2');
|
|
3
3
|
require('../proposals/change-array-by-copy');
|
|
4
|
+
// TODO: Obsolete versions, remove from `core-js@4`
|
|
5
|
+
require('../proposals/array-grouping-stage-3');
|
|
4
6
|
var parent = require('./4');
|
|
5
7
|
|
|
6
8
|
module.exports = parent;
|