Skip to content

Commit e5fb36c

Browse files
ptMutabenjamn
authored andcommitted
Avoid using globalKey in Array due to legacy browser bugs (#3)
Fixes #2.
1 parent a70fd20 commit e5fb36c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/tuple.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ export { tuple };
2929
// object, there's no reliable way to get the global object across all JS
3030
// environments without using the `Function` constructor, so instead we
3131
// use the global `Array` constructor as a shared namespace.
32-
const root = globalKey in Array
33-
? Array[globalKey]
34-
: def(Array, globalKey, new UniversalWeakMap, false);
32+
const root = Array[globalKey] || def(Array, globalKey, new UniversalWeakMap, false);
3533

3634
function intern(array) {
3735
let node = root;

0 commit comments

Comments
 (0)