-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
shell.js: Handle if location object does not exist #17318
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
In general this sounds good. Please take a look at the CI errors though, and let us know if you can't figure them out.
One possibility is that ?.
notation may not be supported in one of our tools (I don't think we use it anywhere atm). But that's just a guess.
When compiling with the options introduced in [this comment](emscripten-core#13190 (comment)), the `ENVIRONMENT_IS_WORKER` value is set to `true`. In Deno, the value of `self.location` is `undefined` when the `deno run` command is executed without the `--location` CLI argument. In the scenario of creating the Deno library, it is difficult to tell the library user to input the `--location` CLI argument, so I modified it to handle fallback at this level.
Regarding the |
Co-authored-by: Alon Zakai <alonzakai@gmail.com>
I looked into this a little more now. It seems like node also does not define Lines 31 to 37 in 1056be2
@disjukr is the problem with Deno also just when using pthreads? If so, then I think working around it in |
In my situation, when the wasm-ld: error: --shared-memory is disallowed by enc/webp_enc.o because it was not compiled with 'atomics' or 'bulk-memory' features. I'm not familiar with c/cpp so I can't narrow down the reproduction path properly, but when I built a very simple pthread example, the |
Oh sorry. I noticed that I accidentally included the |
When compiling with the options introduced in this comment, the
ENVIRONMENT_IS_WORKER
value is set totrue
.In Deno, the value of
self.location
isundefined
when thedeno run
command is executed without the--location
CLI argument.In the scenario of creating the Deno library, it is difficult to tell the library user to input the
--location
CLI argument, so I modified it to handle fallback at this level.