Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have global exports be compatible with Web Workers
Assigning to `window` only works in a normal browser environment; however, Web Workers don't have access to `window`. Instead, the global object inside Web Workers is `self`. Browserify ensures that `global` is present to all scripts by creating a shim reference to it using this logic: typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {} Thus, if neither `global` nor `self` were originally present, `global === window` will be true. Web Workers compatibility was broken in a81e555.
- Loading branch information