8000 fix some possible problems related multiple global copies of `core-js… · zloirock/core-js@784cda1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 784cda1

Browse files
committed
fix some possible problems related multiple global copies of core-js, #880
1 parent fb28f12 commit 784cda1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Fixed microtask implementation in engines with `MutationObserver`, but without `document`, [#865](https://github.com/zloirock/core-js/issues/865), [#866](https://github.com/zloirock/core-js/issues/866)
1111
- Fixed `core-js-builder` with an empty (after the targets engines or another filtration) modules list, [#822](https://github.com/zloirock/core-js/issues/822)
1212
- Fixed possible twice call of `window.onunhandledrejection`, [#760](https://github.com/zloirock/core-js/issues/760)
13+
- Fixed some possible problems related multiple global copies of `core-js`, [#880](https://github.com/zloirock/core-js/issues/880)
1314
- Added a workaround for 3rd party `Reflect.set` polyfill bug, [#847](https://github.com/zloirock/core-js/issues/847)
1415
- Forced replacement of `Array#{ reduce, reduceRight }` in Chrome 80-82 because of [a bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1049982), [#766](https://github.com/zloirock/core-js/issues/766)
1516
- Updated compat data:

packages/core-js/internals/internal-state.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var global = require('../internals/global');
33
var isObject = require('../internals/is-object');
44
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
55
var objectHas = require('../internals/has');
6+
var shared = require('../internals/shared-store');
67
var sharedKey = require('../internals/shared-key');
78
var hiddenKeys = require('../internals/hidden-keys');
89

@@ -23,7 +24,7 @@ var getterFor = function (TYPE) {
2324
};
2425

2526
if (NATIVE_WEAK_MAP) {
26-
var store = new WeakMap();
27+
var store = shared.state || (shared.state = new WeakMap());
2728
var wmget = store.get;
2829
var wmhas = store.has;
2930
var wmset = store.set;

0 commit comments

Comments
 (0)
0