Skip to content

Commit

Permalink
remove %TypedArray%.prototype.toSpliced method from the change arra…
Browse files Browse the repository at this point in the history
…y by copy proposal and mark as obsolete in `core-js`

tc39/proposal-change-array-by-copy#88
  • Loading branch information
zloirock committed Jul 24, 2022
1 parent c2620d2 commit 485d383
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 16 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
- Do not validate value in `%WrapForValid(Async)IteratorPrototype%.next`, [proposal-iterator-helpers/197](https://github.com/tc39/proposal-iterator-helpers/pull/197) and [proposal-iterator-helpers/205](https://github.com/tc39/proposal-iterator-helpers/pull/205)
- Do not forward the parameter of `.next` / `.return` to an underlying iterator by the extended iterator protocol, a part of [proposal-iterator-helpers/194](https://github.com/tc39/proposal-iterator-helpers/pull/194)
- `.throw` methods removed from all wrappers / helpers prototypes, a part of [proposal-iterator-helpers/194](https://github.com/tc39/proposal-iterator-helpers/pull/194)
- Close inner iterators in `{ Iterator, AsyncIterator }.prototype.flatMap` on `.return`, [proposal-iterator-helpers/195](https://github.com/tc39/proposal-iterator-helpers/pull/195)
- Close inner iterators of `{ Iterator, AsyncIterator }.prototype.flatMap` proxy iterators on `.return`, [proposal-iterator-helpers/195](https://github.com/tc39/proposal-iterator-helpers/pull/195)
- Throw `RangeError` on `NaN` in `{ Iterator, AsyncIterator }.prototype.{ drop, take }`, [proposal-iterator-helpers/181](https://github.com/tc39/proposal-iterator-helpers/pull/181)
- Many other updates and fixes of this proposal
- `%TypedArray%.prototype.toSpliced` method removed from the [change array by copy proposal](https://github.com/tc39/proposal-change-array-by-copy) and marked as obsolete in `core-js`, [proposal-change-array-by-copy/88](https://github.com/tc39/proposal-change-array-by-copy/issues/88)
- Polyfill `Promise` with `unhandledrejection` event support (browser style) in Deno < [1.24](https://github.com/denoland/deno/releases/tag/v1.24.0)
- Added compat data for Bun, [#1103](https://github.com/zloirock/core-js/issues/1103)
- Added compat data for Hermes, [#1099](https://github.com/zloirock/core-js/issues/1099)
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,7 @@ map.get(1); // => [1, 3, 5]
map.get(0); // => [2, 4]
````
##### [Change `Array` by copy](https://github.com/tc39/proposal-change-array-by-copy)[⬆](#index)
Modules [`esnext.array.to-reversed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-reversed.js), [`esnext.array.to-sorted`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-sorted.js), [`esnext.array.to-spliced`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-spliced.js), [`esnext.array.with`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.with.js), [`esnext.typed-array.to-reversed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-reversed.js), [`esnext.typed-array.to-sorted`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-sorted.js), [`esnext.typed-array.to-spliced`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-spliced.js), [`esnext.typed-array.with`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.with.js).
Modules [`esnext.array.to-reversed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-reversed.js), [`esnext.array.to-sorted`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-sorted.js), [`esnext.array.to-spliced`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-spliced.js), [`esnext.array.with`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.with.js), [`esnext.typed-array.to-reversed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-reversed.js), [`esnext.typed-array.to-sorted`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-sorted.js), [`esnext.typed-array.with`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.with.js).
```js
class Array {
toReversed(): Array<mixed>;
Expand All @@ -2138,7 +2138,6 @@ class Array {

class %TypedArray% {
toReversed(): %TypedArray%;
toSpliced(start?: number, deleteCount?: number, ...items: %TypedArray%): %TypedArray%;
toSorted(comparefn?: (a: any, b: any) => number): %TypedArray%;
with(index: includes, value: any): %TypedArray%;
}
Expand All @@ -2152,7 +2151,6 @@ core-js(-pure)/actual|full/array(/virtual)/to-spliced
core-js(-pure)/actual|full/array(/virtual)/with
core-js/actual|full/typed-array/to-reversed
core-js/actual|full/typed-array/to-sorted
core-js/actual|full/typed-array/to-spliced
core-js/actual|full/typed-array/with
```
[*Examples*](https://is.gd/tVkbY3):
Expand Down
1 change: 1 addition & 0 deletions packages/core-js-compat/src/data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,7 @@ export const data = {
'esnext.typed-array.to-sorted': {
bun: '0.1.1',
},
// TODO: Remove from `core-js@4`
'esnext.typed-array.to-spliced': {
},
'esnext.typed-array.unique-by': {
Expand Down
1 change: 1 addition & 0 deletions packages/core-js/actual/typed-array/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require('../../modules/esnext.typed-array.find-last');
require('../../modules/esnext.typed-array.find-last-index');
require('../../modules/esnext.typed-array.to-reversed');
require('../../modules/esnext.typed-array.to-sorted');
// TODO: Remove from `core-js@4`
require('../../modules/esnext.typed-array.to-spliced');
require('../../modules/esnext.typed-array.with');

Expand Down
1 change: 1 addition & 0 deletions packages/core-js/actual/typed-array/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require('../../modules/esnext.typed-array.find-last');
require('../../modules/esnext.typed-array.find-last-index');
require('../../modules/esnext.typed-array.to-reversed');
require('../../modules/esnext.typed-array.to-sorted');
// TODO: Remove from `core-js@4`
require('../../modules/esnext.typed-array.to-spliced');
require('../../modules/esnext.typed-array.with');

Expand Down
1 change: 1 addition & 0 deletions packages/core-js/actual/typed-array/to-spliced.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// TODO: Remove from `core-js@4`
require('../../modules/esnext.typed-array.to-spliced');
1 change: 1 addition & 0 deletions packages/core-js/full/typed-array/to-spliced.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TODO: Remove from `core-js@4`
var parent = require('../../actual/typed-array/to-spliced');

module.exports = parent;
1 change: 1 addition & 0 deletions packages/core-js/modules/esnext.typed-array.to-spliced.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
// TODO: Remove from `core-js@4`
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var toAbsoluteIndex = require('../internals/to-absolute-index');
Expand Down
1 change: 1 addition & 0 deletions packages/core-js/proposals/change-array-by-copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ require('../modules/esnext.array.to-spliced');
require('../modules/esnext.array.with');
require('../modules/esnext.typed-array.to-reversed');
require('../modules/esnext.typed-array.to-sorted');
// TODO: Remove from `core-js@4`
require('../modules/esnext.typed-array.to-spliced');
require('../modules/esnext.typed-array.with');
1 change: 1 addition & 0 deletions scripts/check-compat-tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const ignore = new Set([
'esnext.typed-array.from-async',
'esnext.typed-array.filter-out',
'esnext.typed-array.group-by',
'esnext.typed-array.to-spliced',
'esnext.weak-map.upsert',
'web.url-search-params',
'web.url',
Expand Down
12 changes: 0 additions & 12 deletions tests/compat/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1719,18 +1719,6 @@ GLOBAL.tests = {
'esnext.typed-array.to-sorted': function () {
return Int8Array.prototype.toSorted;
},
'esnext.typed-array.to-spliced': function () {
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;
},
'esnext.typed-array.unique-by': function () {
return Int8Array.prototype.uniqueBy;
},
Expand Down
1 change: 1 addition & 0 deletions tests/tests/esnext.typed-array.to-spliced.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TODO: Remove from `core-js@4`
import { DESCRIPTORS, GLOBAL, TYPED_ARRAYS } from '../helpers/constants';

if (DESCRIPTORS) QUnit.test('%TypedArrayPrototype%.toSpliced', assert => {
Expand Down

0 comments on commit 485d383

Please sign in to comment.