forked from drses/weak-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsync.patch
48 lines (43 loc) · 1.29 KB
/
sync.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
diff --git a/weak-map.js b/weak-map.js
index 9fa5d81..116ca05 100644
--- a/weak-map.js
+++ b/weak-map.js
@@ -77,7 +77,6 @@
* prevent access to this channel. (See
* PATCH_MUTABLE_FROZEN_WEAKMAP_PROTO in repairES5.js).
*/
-var WeakMap;
/**
* If this is a full <a href=
@@ -127,8 +126,8 @@ var WeakMap;
// Check if there is already a good-enough WeakMap implementation, and if so
// exit without replacing it.
- var HostWeakMap = WeakMap;
- if (typeof HostWeakMap === 'function') {
+ if (typeof WeakMap === 'function') {
+ var HostWeakMap = WeakMap;
// There is a WeakMap -- is it good enough?
if (typeof navigator !== 'undefined' &&
/Firefox/.test(navigator.userAgent)) {
@@ -150,6 +149,7 @@ var WeakMap;
// Fall through to installing our WeakMap.
} else {
+ module.exports = WeakMap;
return;
}
}
@@ -565,7 +565,7 @@ var WeakMap;
});
}
DoubleWeakMap.prototype = OurWeakMap.prototype;
- WeakMap = DoubleWeakMap;
+ module.exports = DoubleWeakMap;
// define .constructor to hide OurWeakMap ctor
Object.defineProperty(WeakMap.prototype, 'constructor', {
@@ -585,6 +585,6 @@ var WeakMap;
Proxy = undefined;
}
- WeakMap = OurWeakMap;
+ module.exports = OurWeakMap;
}
})();