diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b8595712951..80f2663074d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Added one more workaround of a `webpack` dev server bug on IE global methods, [#1161](https://github.com/zloirock/core-js/issues/1161) - Fixed possible `String.{ raw, cooked }` error with empty template array - Used non-standard V8 `Error.captureStackTrace` instead of stack parsing in new error classes / wrappers where it's possible +- Added detection correctness of iteration to `Promise.{ allSettled, any }` feature detection, Hermes issue - Compat data improvements: - [Change `Array` by copy proposal](https://github.com/tc39/proposal-change-array-by-copy) marked as supported from V8 ~ Chrome 110 - Added Samsung Internet 20 compat data mapping diff --git a/packages/core-js/modules/es.promise.all-settled.js b/packages/core-js/modules/es.promise.all-settled.js index 48e017356769..73b282a49a3a 100644 --- a/packages/core-js/modules/es.promise.all-settled.js +++ b/packages/core-js/modules/es.promise.all-settled.js @@ -5,10 +5,11 @@ var aCallable = require('../internals/a-callable'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); +var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); // `Promise.allSettled` method // https://tc39.es/ecma262/#sec-promise.allsettled -$({ target: 'Promise', stat: true }, { +$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { allSettled: function allSettled(iterable) { var C = this; var capability = newPromiseCapabilityModule.f(C); diff --git a/packages/core-js/modules/es.promise.any.js b/packages/core-js/modules/es.promise.any.js index 6a414d81f23b..dd92bd76bc0a 100644 --- a/packages/core-js/modules/es.promise.any.js +++ b/packages/core-js/modules/es.promise.any.js @@ -6,12 +6,13 @@ var getBuiltIn = require('../internals/get-built-in'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); +var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); var PROMISE_ANY_ERROR = 'No one promise resolved'; // `Promise.any` method // https://tc39.es/ecma262/#sec-promise.any -$({ target: 'Promise', stat: true }, { +$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { any: function any(iterable) { var C = this; var AggregateError = getBuiltIn('AggregateError'); diff --git a/tests/compat/tests.js b/tests/compat/tests.js index 7f778ea60f21..2a36b4f16bfb 100644 --- a/tests/compat/tests.js +++ b/tests/compat/tests.js @@ -883,12 +883,12 @@ GLOBAL.tests = { 'es.promise.all': [PROMISES_SUPPORT, SAFE_ITERATION_CLOSING_SUPPORT, PROMISE_STATICS_ITERATION, function () { return Promise.all; }], - 'es.promise.all-settled': function () { + 'es.promise.all-settled': [PROMISES_SUPPORT, SAFE_ITERATION_CLOSING_SUPPORT, PROMISE_STATICS_ITERATION, function () { return Promise.allSettled; - }, - 'es.promise.any': function () { + }], + 'es.promise.any': [PROMISES_SUPPORT, SAFE_ITERATION_CLOSING_SUPPORT, PROMISE_STATICS_ITERATION, function () { return Promise.any; - }, + }], 'es.promise.catch': PROMISES_SUPPORT, 'es.promise.finally': [PROMISES_SUPPORT, function () { // eslint-disable-next-line unicorn/no-thenable -- required for testing