Skip to content

Commit

Permalink
working around breakage related to zone.js loaded before core-js, c…
Browse files Browse the repository at this point in the history
…lose #953
  • Loading branch information
zloirock committed Jun 27, 2021
1 parent 719bae9 commit 9125de6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Changelog
##### Unreleased
- Worked around breakage related to `zone.js` loaded before `core-js`, [#953](https://github.com/zloirock/core-js/issues/953)
- Added NodeJS 16.4 -> Chrome 91 compat data mapping

##### 3.15.1 - 2021.06.23
Expand Down
5 changes: 3 additions & 2 deletions packages/core-js/modules/es.promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ var SUBCLASSING = false;
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;

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

0 comments on commit 9125de6

Please sign in to comment.