{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3577","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3577/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3577/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3577/events","html_url":"https://github.com/kripken/emscripten/pull/3577","id":90768021,"number":3577,"title":"Set ENVIRONMENT_IS_WEB for Web Workers","user":{"login":"blixt","id":158591,"avatar_url":"https://avatars.githubusercontent.com/u/158591?v=3","gravatar_id":"","url":"https://api.github.com/users/blixt","html_url":"https://github.com/blixt","followers_url":"https://api.github.com/users/blixt/followers","following_url":"https://api.github.com/users/blixt/following{/other_user}","gists_url":"https://api.github.com/users/blixt/gists{/gist_id}","starred_url":"https://api.github.com/users/blixt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blixt/subscriptions","organizations_url":"https://api.github.com/users/blixt/orgs","repos_url":"https://api.github.com/users/blixt/repos","events_url":"https://api.github.com/users/blixt/events{/privacy}","received_events_url":"https://api.github.com/users/blixt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-24T19:57:13Z","updated_at":"2015-06-26T20:44:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/3577","html_url":"https://github.com/kripken/emscripten/pull/3577","diff_url":"https://github.com/kripken/emscripten/pull/3577.diff","patch_url":"https://github.com/kripken/emscripten/pull/3577.patch"},"body":"Web Workers are also run in web environments (albeit without the `window` global), and cannot access Node.js specifics. Considering them to be web will avoid breaking Browserify scripts that are run as Web Workers (because Browserify simulates a Node.js environment, making Emscripten think it's running as Node.js).\r\n\r\nI've successfully used code with this change, but please take into consideration corner cases where `ENVIRONMENT_IS_WEB`-only code attempts to access the `window` global or any other global that is not accessible within a Web Worker."},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/115875328","html_url":"https://github.com/kripken/emscripten/pull/3577#issuecomment-115875328","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3577","id":115875328,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2015-06-26T20:44:28Z","updated_at":"2015-06-26T20:44:28Z","body":"I think the `ENVIRONMENT_IS_*` are meant to be disjoint, that is, only one should be true at once. See the checks on them in `src/*.js`. We would need to look at every single one of those and make sure there are no problems with this change.\r\n\r\nWhat is the specific issue with browserify? Perhaps there is another solution?"}}