Skip to content

Fix a crash if the worker has the 'window' object defined #7231

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

Merged
merged 2 commits into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,4 @@ a license to everyone to use it as detailed in LICENSE.)
* Elmo Todurov <[email protected]>
* Zoltán Žarkov <[email protected]>
* Roman Yurchak <[email protected]>
* Hampton Maxwell <[email protected]>
8 changes: 3 additions & 5 deletions src/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,10 @@ if (ENVIRONMENT_IS_SHELL) {
#endif // ENVIRONMENT_MAY_BE_SHELL
#if ENVIRONMENT_MAY_BE_WEB_OR_WORKER
if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
if (ENVIRONMENT_IS_WEB) {
if (document.currentScript) {
scriptDirectory = document.currentScript.src;
}
} else { // worker
if (ENVIRONMENT_IS_WORKER) { // Check worker, not web, since window could be polyfilled
scriptDirectory = self.location.href;
} else if (document.currentScript) { // web
scriptDirectory = document.currentScript.src;
}
#if MODULARIZE
#if MODULARIZE_INSTANCE == 0
Expand Down