Commit b134a75
committed
Use es5-ext/global as a more robust way to resolve browser's window
The [es5-ext/global][es5g] module is based on Mathias Bynens' [polyfill][poly]
for [`globalThis`][gT]. It uses the same robust technique but is more
conservative in that it does not add a `globalThis` property to the resolved
object, i.e. `window` in a browser and `global` in Node. It also lacks the "old
IE" fallback seen in a [demo][demo] of the original polyfill, but that is
easily provided in this commit.
[es5g]: https://github.com/medikoo/es5-ext/blob/master/global.js
[poly]: https://mathiasbynens.be/notes/globalthis
[gT]: https://github.com/tc39/proposal-global
[demo]: https://mathiasbynens.be/demo/globalthis-ie1 parent f78487c commit b134a75
2 files changed
+11
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments