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

expose forget to wasm #1544

Merged
merged 2 commits into from
May 20, 2019
Merged

expose forget to wasm #1544

merged 2 commits into from
May 20, 2019

Conversation

ibaryshnikov
Copy link
Member

@ibaryshnikov ibaryshnikov commented May 19, 2019

Closes #1543

I made some research on the issue

forget is exposed here:
https://github.com/rustwasm/wasm-bindgen/blob/master/crates/cli-support/src/js/mod.rs#L792

Then there is a line if contents.starts_with("function") { here
https://github.com/rustwasm/wasm-bindgen/blob/master/crates/cli-support/src/js/mod.rs#L229

Well, it's not a class and not a function, that's why we go here:
https://github.com/rustwasm/wasm-bindgen/blob/master/crates/cli-support/src/js/mod.rs#L252

Probably, exposing to wasm every exported const is not the best idea, but it depends on the usage. If only function aliases are bound in such way, it's fine enough.

@alexcrichton
Copy link
Contributor

Looks great to me, thanks @ibaryshnikov!

@alexcrichton alexcrichton merged commit f23b867 into rustwasm:master May 20, 2019
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.

error on init (__wbindgen_cb_forget)
2 participants