Exporting a Rust function with an argument named wasm
can sometimes clash with internal wasm
JavaScript var
#3729
Labels
wasm
can sometimes clash with internal wasm
JavaScript var
#3729
Describe the Bug
If you export a Rust function with an argument named
wasm
, it will in some cases throw an error when called from JavaScript.Steps to Reproduce
I exported a function with this signature:
It generates this on the JavaScript side:
In the
finally
block, it tries to refer to an internalwasm
variable but this fails due to the name of the argument.Expected Behavior
The
#[wasm_bindgen]
macro should probably throw a compiler error, or more naturally should internally rename the function argument on the JS side to resolve the clash.Actual Behavior
It compiles with no errors but fails at runtime.
The text was updated successfully, but these errors were encountered: