From 14d6d89611ed0be8a358c6f33746ddf5a69d1772 Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Wed, 27 Mar 2019 16:58:44 +0700 Subject: [PATCH] move `Promise.allSettled` to stage 3 per https://github.com/babel/proposals/issues/57#issuecomment-476837985 --- README.md | 38 ++++++++++++++++++------------------- packages/core-js/stage/2.js | 1 - packages/core-js/stage/3.js | 1 + 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d219e8721171..8d689e14875f 100644 --- a/README.md +++ b/README.md @@ -1605,6 +1605,25 @@ core-js(-pure)/features/global-this ```js globalThis.Array === Array; // => true ``` +* `Promise.allSettled` [proposal](https://github.com/tc39/proposal-promise-allSettled) - module [`esnext.promise.all-settled`](https://github.com/zloirock/core-js/blob/v3.0.1/packages/core-js/modules/esnext.promise.all-settled.js) +```js +class Promise { + static allSettled(iterable): promise; +} +``` +[*CommonJS entry points:*](#commonjs-api) +```js +core-js/proposals/promise-all-settled +core-js(-pure)/features/promise/all-settled +``` +[*Examples*](https://goo.gl/PXXLNJ): +```js +Promise.allSettled([ + Promise.resolve(1), + Promise.reject(2), + Promise.resolve(3), +]).then(console.log); // => [{ value: 1, status: 'fulfilled' }, { reason: 2, status: 'rejected' }, { value: 3, status: 'fulfilled' }] +``` #### Stage 2 proposals [*CommonJS entry points:*](#commonjs-api) @@ -1645,25 +1664,6 @@ new Set([1, 2, 3]).isDisjointFrom([4, 5, 6]); // => true new Set([1, 2, 3]).isSubsetOf([5, 4, 3, 2, 1]); // => true new Set([5, 4, 3, 2, 1]).isSupersetOf([1, 2, 3]); // => true ``` -* `Promise.allSettled` [proposal](https://github.com/tc39/proposal-promise-allSettled) - module [`esnext.promise.all-settled`](https://github.com/zloirock/core-js/blob/v3.0.1/packages/core-js/modules/esnext.promise.all-settled.js) -```js -class Promise { - static allSettled(iterable): promise; -} -``` -[*CommonJS entry points:*](#commonjs-api) -```js -core-js/proposals/promise-all-settled -core-js(-pure)/features/promise/all-settled -``` -[*Examples*](https://goo.gl/PXXLNJ): -```js -Promise.allSettled([ - Promise.resolve(1), - Promise.reject(2), - Promise.resolve(3), -]).then(console.log); // => [{ value: 1, status: 'fulfilled' }, { reason: 2, status: 'rejected' }, { value: 3, status: 'fulfilled' }] -``` #### Stage 1 proposals [*CommonJS entry points:*](#commonjs-api) diff --git a/packages/core-js/stage/2.js b/packages/core-js/stage/2.js index a97dbc26a60f..872defffa76f 100644 --- a/packages/core-js/stage/2.js +++ b/packages/core-js/stage/2.js @@ -1,4 +1,3 @@ require('../proposals/set-methods'); -require('../proposals/promise-all-settled'); module.exports = require('./3'); diff --git a/packages/core-js/stage/3.js b/packages/core-js/stage/3.js index 0bae3e047f39..6e8fccb206e5 100644 --- a/packages/core-js/stage/3.js +++ b/packages/core-js/stage/3.js @@ -1,4 +1,5 @@ require('../proposals/global-this'); require('../proposals/string-match-all'); +require('../proposals/promise-all-settled'); module.exports = require('./4');