Skip to content

Conversation

@nazar-pc
Copy link
Contributor

fetch() can be present in some environments like Electron's renderer process, but is not useful outside browser environment

This is an alternative, simpler approach to #5577

// if we don't have the binary yet, and have the Fetch api, use that
if (!Module['wasmBinary'] && typeof fetch === 'function') {
// if we don't have the binary yet, and have the Fetch api, use that, but only when in browser environment
if (!Module['wasmBinary'] && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === 'function') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall this looks reasonable to me, thanks. please just add to the comment something like in some other environments, like Electron, fetch may exist but behave differently than on the Web, so avoid it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased, is it better now?

…r process, but is not useful outside browser environment
@kripken kripken merged commit b1f07c5 into emscripten-core:incoming Sep 20, 2017
@kripken
Copy link
Member

kripken commented Sep 20, 2017

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants