Commit 8bb6e31
authored
Because of JS hoisting `var global` to the top of the file, `typeof
global` in `getGlobal()` will always be `undefined`.
By using a different variable name like `globalObject`, we are able to
read the "real" `typeof global` and get access to the global object that
way.
1 parent e218f8d commit 8bb6e31
1 file changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments