Skip to content

Commit eff765f

Browse files
committed
disable forced replacement for methods from "Change Array by copy" proposal
1 parent a7aab7f commit eff765f

9 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
##### Unreleased
33
- [Change `Array` by copy proposal](https://github.com/tc39/proposal-change-array-by-copy):
44
- Moved to Stage 3, [March TC39 meeting](https://github.com/babel/proposals/issues/81#issuecomment-1083449843)
5+
- Disabled forced replacement and added `/actual/` entry points for methods from this proposal
56
- `Array.prototype.toSpliced` throws a `TypeError` instead of `RangeError` if the result length is more than `MAX_SAFE_INTEGER`, [proposal-change-array-by-copy/70](https://github.com/tc39/proposal-change-array-by-copy/pull/70)
67
- Added some more `atob` / `btoa` fixes:
78
- NodeJS <17.9 `atob` does not ignore spaces, [node/42530](https://github.com/nodejs/node/issues/42530)

packages/core-js/modules/esnext.array.to-reversed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var Array = global.Array;
99

1010
// `Array.prototype.toReversed` method
1111
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed
12-
$({ target: 'Array', proto: true, forced: true }, {
12+
$({ target: 'Array', proto: true }, {
1313
toReversed: function toReversed() {
1414
return arrayToReversed(toIndexedObject(this), Array);
1515
}

packages/core-js/modules/esnext.array.to-sorted.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var sort = uncurryThis(getVirtual('Array').sort);
1313

1414
// `Array.prototype.toSorted` method
1515
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSorted
16-
$({ target: 'Array', proto: true, forced: true }, {
16+
$({ target: 'Array', proto: true }, {
1717
toSorted: function toSorted(compareFn) {
1818
if (compareFn !== undefined) aCallable(compareFn);
1919
var O = toIndexedObject(this);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var Array = global.Array;
1010

1111
// `Array.prototype.toSpliced` method
1212
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSpliced
13-
$({ target: 'Array', proto: true, forced: true }, {
13+
$({ target: 'Array', proto: true }, {
1414
// eslint-disable-next-line no-unused-vars -- required for .length
1515
toSpliced: function toSpliced(start, deleteCount /* , ...items */) {
1616
return arrayToSpliced(toIndexedObject(this), Array, arraySlice(arguments));

packages/core-js/modules/esnext.array.with.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var Array = global.Array;
88

99
// `Array.prototype.with` method
1010
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with
11-
$({ target: 'Array', proto: true, forced: true }, {
11+
$({ target: 'Array', proto: true }, {
1212
'with': function (index, value) {
1313
return arrayWith(toIndexedObject(this), Array, index, value);
1414
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
1010
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed
1111
exportTypedArrayMethod('toReversed', function toReversed() {
1212
return arrayToReversed(aTypedArray(this), this[TYPED_ARRAY_CONSTRUCTOR]);
13-
}, true);
13+
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ exportTypedArrayMethod('toSorted', function toSorted(compareFn) {
1616
var O = aTypedArray(this);
1717
var A = arrayFromConstructorAndList(O[TYPED_ARRAY_CONSTRUCTOR], O);
1818
return sort(A, compareFn);
19-
}, true);
19+
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
1212
// eslint-disable-next-line no-unused-vars -- required for .length
1313
exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , ...items */) {
1414
return arrayToSpliced(aTypedArray(this), this[TYPED_ARRAY_CONSTRUCTOR], arraySlice(arguments));
15-
}, true);
15+
});

packages/core-js/modules/esnext.typed-array.with.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
1010
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with
1111
exportTypedArrayMethod('with', { 'with': function (index, value) {
1212
return arrayWith(aTypedArray(this), this[TYPED_ARRAY_CONSTRUCTOR], index, value);
13-
} }['with'], true);
13+
} }['with']);

0 commit comments

Comments
 (0)