You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a rust struct that is using #[wasm_bindgen] tooling with #[wasm_bindgen(getter)] functions. I'm seeing inconsistent behavior when building my project in Release and Debug mode.
In Debug Mode, accessing the getter in javascript land resolves to the returned object of the getter method.
In Release Mode, accessing the getter in javascript land resolves to a function/method. This happens with both the #[wasm_bindgen(getter)] proc macro for functions and the #[wasm_bindgen(getter_with_clone)] proc macro for the struct.
Steps to Reproduce
wasm-bindgen 0.2.92
I'm using OSX Sonoma on Apple Silicon and Chrome 123.x
Describe the Bug
I have a rust struct that is using
#[wasm_bindgen]
tooling with#[wasm_bindgen(getter)]
functions. I'm seeing inconsistent behavior when building my project in Release and Debug mode.In Debug Mode, accessing the getter in javascript land resolves to the returned object of the getter method.
In Release Mode, accessing the getter in javascript land resolves to a function/method. This happens with both the
#[wasm_bindgen(getter)]
proc macro for functions and the#[wasm_bindgen(getter_with_clone)]
proc macro for the struct.Steps to Reproduce
cargo install --locked trunk
trunk serve
localhost:8080
. Observe console log of "hello world"trunk serve --release
localhost:8080
. Observe console log of "function...."Expected Behavior
Debug and Release should be the same
Actual Behavior
Differing results in Debug and Release
The text was updated successfully, but these errors were encountered: