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

Removing self from no-modules target #1995

Merged
merged 1 commit into from
Feb 10, 2020

Conversation

Pauan
Copy link
Contributor

@Pauan Pauan commented Feb 10, 2020

Some JS targets don't have self, so this removes self from the no-modules target.

The behavior should be the same, it still creates a global wasm_bindgen variable and assigns to it.

This is accomplished by creating the variable outside of the function and then assigning to it inside the function.

@alexcrichton
Copy link
Contributor

Thanks!

@alexcrichton alexcrichton merged commit 91f0dbd into rustwasm:master Feb 10, 2020
@Pauan Pauan deleted the removing-self branch February 10, 2020 23:04
migerh added a commit to migerh/rustwasm-gif that referenced this pull request Oct 20, 2022
This requires manual patching of the gif.js output now. With
rustwasm/wasm-bindgen#1995
the `self.` prefix was removed from the JS wrapper output. This means it
will no longer properly inject the wasm_bindgen wrapper code into the
WebWorker context. To fix this for now follow these steps:

* Remove the first line that declares wasm_bindgen
* Add `self.` in front of `wasm_bindgen` definition at the end
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