Skip to content

Commit 7f8fce9

Browse files
committedJan 13, 2023
add detection correctness of iteration to Promise.{ allSettled, any } feature detection, Hermes issue
1 parent fcd5af4 commit 7f8fce9

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Added one more workaround of a `webpack` dev server bug on IE global methods, [#1161](https://github.com/zloirock/core-js/issues/1161)
44
- Fixed possible `String.{ raw, cooked }` error with empty template array
55
- Used non-standard V8 `Error.captureStackTrace` instead of stack parsing in new error classes / wrappers where it's possible
6+
- Added detection correctness of iteration to `Promise.{ allSettled, any }` feature detection, Hermes issue
67
- Compat data improvements:
78
- [Change `Array` by copy proposal](https://github.com/tc39/proposal-change-array-by-copy) marked as supported from V8 ~ Chrome 110
89
- Added Samsung Internet 20 compat data mapping

‎packages/core-js/modules/es.promise.all-settled.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ var aCallable = require('../internals/a-callable');
55
var newPromiseCapabilityModule = require('../internals/new-promise-capability');
66
var perform = require('../internals/perform');
77
var iterate = require('../internals/iterate');
8+
var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');
89

910
// `Promise.allSettled` method
1011
// https://tc39.es/ecma262/#sec-promise.allsettled
11-
$({ target: 'Promise', stat: true }, {
12+
$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
1213
allSettled: function allSettled(iterable) {
1314
var C = this;
1415
var capability = newPromiseCapabilityModule.f(C);

‎packages/core-js/modules/es.promise.any.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ var getBuiltIn = require('../internals/get-built-in');
66
var newPromiseCapabilityModule = require('../internals/new-promise-capability');
77
var perform = require('../internals/perform');
88
var iterate = require('../internals/iterate');
9+
var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');
910

1011
var PROMISE_ANY_ERROR = 'No one promise resolved';
1112

1213
// `Promise.any` method
1314
// https://tc39.es/ecma262/#sec-promise.any
14-
$({ target: 'Promise', stat: true }, {
15+
$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
1516
any: function any(iterable) {
1617
var C = this;
1718
var AggregateError = getBuiltIn('AggregateError');

‎tests/compat/tests.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -883,12 +883,12 @@ GLOBAL.tests = {
883883
'es.promise.all': [PROMISES_SUPPORT, SAFE_ITERATION_CLOSING_SUPPORT, PROMISE_STATICS_ITERATION, function () {
884884
return Promise.all;
885885
}],
886-
'es.promise.all-settled': function () {
886+
'es.promise.all-settled': [PROMISES_SUPPORT, SAFE_ITERATION_CLOSING_SUPPORT, PROMISE_STATICS_ITERATION, function () {
887887
return Promise.allSettled;
888-
},
889-
'es.promise.any': function () {
888+
}],
889+
'es.promise.any': [PROMISES_SUPPORT, SAFE_ITERATION_CLOSING_SUPPORT, PROMISE_STATICS_ITERATION, function () {
890890
return Promise.any;
891-
},
891+
}],
892892
'es.promise.catch': PROMISES_SUPPORT,
893893
'es.promise.finally': [PROMISES_SUPPORT, function () {
894894
// eslint-disable-next-line unicorn/no-thenable -- required for testing

0 commit comments

Comments
 (0)
Please sign in to comment.