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

webAudio mistypo with --target no-modules #1311

Closed
simdax opened this issue Mar 3, 2019 · 3 comments
Closed

webAudio mistypo with --target no-modules #1311

simdax opened this issue Mar 3, 2019 · 3 comments
Labels
bug examples Example programs in the `examples/` directory.

Comments

@simdax
Copy link

simdax commented Mar 3, 2019

🐛 Bug description

When building the webaudio example, the main .js file instantiate a
new lAudioContext instead of a simple new AudioContext

🤔 Expected Behavior

It should call AudioContext, not lAudioContext

👟 Steps to reproduce

simply copy the webaudio example of wasm-bindgen package, build it with wasm-pack --target no-modules && grep -rn lAudio pkg and you'll see the error

🌍 Your environment

Include the relevant details of your environment.
wasm-pack version: 0.5.1
rustc version: 1.32.0-nightly

@fitzgen fitzgen transferred this issue from rustwasm/wasm-pack Mar 4, 2019
@fitzgen fitzgen added bug examples Example programs in the `examples/` directory. labels Mar 4, 2019
@ibaryshnikov
Copy link
Member

After a short debug I found

[crates/cli-support/src/js/mod.rs:2105] name = "AudioContext"
[crates/cli-support/src/js/mod.rs:2141] class.to_string() = "lAudioContext"
[crates/cli-support/src/js/rust2js.rs:664] c = "lAudioContext"

https://github.com/rustwasm/wasm-bindgen/blob/master/crates/cli-support/src/js/mod.rs#L2105

what's the purpose of format!("l{}", name) ?

@alexcrichton
Copy link
Contributor

Thanks for the report @simdax! This is definitely a bug in wasm-bindgen right now due to the internal branch we have on no-modules vs not. That's being refactored in #1295 and this issue is actually inadvertently fixed by that PR. I suspect that won't take too long to land, so we can fix this with that!

1 similar comment
@alexcrichton

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug examples Example programs in the `examples/` directory.
Projects
None yet
Development

No branches or pull requests

4 participants