Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have global exports be compatible with Web Workers #2053

Merged
merged 1 commit into from
Jan 26, 2016

Commits on Jan 15, 2016

  1. 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.
    mislav committed Jan 15, 2016
    Configuration menu
    Copy the full SHA
    95d7d5b View commit details
    Browse the repository at this point in the history