Skip to content

Commit 95a1749

Browse files
committed
move Array.fromAsync proposal to stage 2
babel/proposals#78 (comment)
1 parent b4826af commit 95a1749

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- `%TypedArray%.prototype.toSpliced`
2626
- `%TypedArray%.prototype.with`
2727
- Added `Iterator.prototype.toAsync` method from [the iterator helpers stage 2 proposal](https://github.com/tc39/proposal-iterator-helpers)
28+
- [`Array.fromAsync` proposal](https://github.com/tc39/proposal-array-from-async) moved to stage 2
2829
- Added [`String.cooked` stage 1 proposal](https://github.com/tc39/proposal-string-cooked):
2930
- `String.cooked`
3031
- Added [`Function.prototype.unThis` stage 0 proposal](https://github.com/js-choi/proposal-function-un-this)

README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,14 @@ Promise.resolve(32).then(x => console.log(x)); // => 32
9797
- [ECMAScript proposals](#ecmascript-proposals)
9898
- [Stage 4 proposals](#stage-4-proposals)
9999
- [Stage 3 proposals](#stage-3-proposals)
100+
- [`Array` grouping](#array-grouping)
100101
- [`Array` find from last](#array-find-from-last)
101102
- [Stage 2 proposals](#stage-2-proposals)
102103
- [`Iterator` helpers](#iterator-helpers)
103104
- [New `Set` methods](#new-set-methods)
104105
- [`Map.prototype.emplace`](#mapprototypeemplace)
105-
- [`Array` grouping](#array-grouping)
106106
- [Change `Array` by copy](#change-array-by-copy)
107+
- [`Array.fromAsync`](#arrayfromasync)
107108
- [`Array.isTemplateObject`](#arrayistemplateobject)
108109
- [`Symbol.{ asyncDispose, dispose }` for `using` statement](#symbol-asyncdispose-dispose--for-using-statement)
109110
- [`Symbol.metadata` for decorators proposal](#symbolmetadata-for-decorators-proposal)
@@ -112,7 +113,6 @@ Promise.resolve(32).then(x => console.log(x)); // => 32
112113
- [New collections methods](#new-collections-methods)
113114
- [`.of` and `.from` methods on collection constructors](#of-and-from-methods-on-collection-constructors)
114115
- [`compositeKey` and `compositeSymbol`](#compositekey-and-compositesymbol)
115-
- [`Array.fromAsync`](#arrayfromasync)
116116
- [`Array` filtering](#array-filtering)
117117
- [`Array` deduplication](#array-deduplication)
118118
- [Getting last item from `Array`](#getting-last-item-from-array)
@@ -2205,6 +2205,22 @@ const correctionNeeded = [1, 1, 3];
22052205
correctionNeeded.with(1, 2); // => [1, 2, 3]
22062206
correctionNeeded; // => [1, 1, 3]
22072207
````
2208+
##### [`Array.fromAsync`](https://github.com/tc39/proposal-array-from-async)[⬆](#index)
2209+
Modules [`esnext.array.from-async`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.from-async.js).
2210+
```js
2211+
class Array {
2212+
static fromAsync(asyncItems: AsyncIterable | Iterable | ArrayLike, mapfn?: (value: any, index: number) => any, thisArg?: any): Array;
2213+
}
2214+
```
2215+
[*CommonJS entry points:*](#commonjs-api)
2216+
```js
2217+
core-js/proposals/array-from-async
2218+
core-js(-pure)/features/array/from-async
2219+
```
2220+
[*Example*](https://goo.gl/Jt7SsD):
2221+
```js
2222+
await Array.fromAsync((async function * (){ yield * [1, 2, 3] })(), i => i * i); // => [1, 4, 9]
2223+
```
22082224
##### [`Array.isTemplateObject`](https://github.com/tc39/proposal-array-is-template-object)[⬆](#index)
22092225
Module [`esnext.array.is-template-object`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.is-template-object.js)
22102226
```js
@@ -2422,22 +2438,6 @@ console.log(compositeSymbol(1, a) === compositeSymbol(1, a)); // => true
24222438
console.log(compositeSymbol(1, a, 2, b) === compositeSymbol(1, a, 2, b)); // => true
24232439
console.log(compositeSymbol(a, a) === compositeSymbol(a, a)); // => true
24242440
```
2425-
##### [`Array.fromAsync`](https://github.com/tc39/proposal-array-from-async)[⬆](#index)
2426-
Modules [`esnext.array.from-async`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.from-async.js).
2427-
```js
2428-
class Array {
2429-
static fromAsync(asyncItems: AsyncIterable | Iterable | ArrayLike, mapfn?: (value: any, index: number) => any, thisArg?: any): Array;
2430-
}
2431-
```
2432-
[*CommonJS entry points:*](#commonjs-api)
2433-
```js
2434-
core-js/proposals/array-from-async
2435-
core-js(-pure)/features/array/from-async
2436-
```
2437-
[*Example*](https://goo.gl/Jt7SsD):
2438-
```js
2439-
await Array.fromAsync((async function * (){ yield * [1, 2, 3] })(), i => i * i); // => [1, 4, 9]
2440-
```
24412441
##### [Array filtering](https://github.com/tc39/proposal-array-filtering)[⬆](#index)
24422442
Modules [`esnext.array.filter-reject`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.filter-reject.js) and [`esnext.typed-array.filter-reject`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.filter-reject.js).
24432443
```js

packages/core-js/stage/1.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require('../proposals/array-filtering');
2-
require('../proposals/array-from-async');
32
require('../proposals/array-last');
43
require('../proposals/array-unique');
54
require('../proposals/collection-methods');

packages/core-js/stage/2.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require('../proposals/array-from-async');
12
require('../proposals/array-is-template-object');
23
require('../proposals/change-array-by-copy');
34
require('../proposals/decorators');

0 commit comments

Comments
 (0)