Skip to content

Commit 9125de6

Browse files
committed
working around breakage related to zone.js loaded before core-js, close #953
1 parent 719bae9 commit 9125de6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Changelog
22
##### Unreleased
3+
- Worked around breakage related to `zone.js` loaded before `core-js`, [#953](https://github.com/zloirock/core-js/issues/953)
34
- Added NodeJS 16.4 -> Chrome 91 compat data mapping
45

56
##### 3.15.1 - 2021.06.23

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ var SUBCLASSING = false;
5555
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
5656

5757
var FORCED = isForced(PROMISE, function () {
58-
var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
58+
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
59+
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
5960
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
6061
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
6162
// We can't detect it synchronously, so just check versions
@@ -65,7 +66,7 @@ var FORCED = isForced(PROMISE, function () {
6566
// We can't use @@species feature detection in V8 since it causes
6667
// deoptimization and performance degradation
6768
// https://github.com/zloirock/core-js/issues/679
68-
if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
69+
if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
6970
// Detect correctness of subclassing with @@species support
7071
var promise = new PromiseConstructor(function (resolve) { resolve(1); });
7172
var FakePromise = function (exec) {

0 commit comments

Comments
 (0)