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
The JavaScript binding for at least one API (JsValue::is_instance_of::<WebAssembly::Global>()) is malformed when building with a profile where codegen-units = 1, changing its behavior across build profiles in unexpected ways.
Steps to Reproduce
Check out this test case and set up a local development environment for a basic wasm-bindgen-based project
Run cargo test --target wasm32-unknown-unknown; the test will pass.
Run cargo test --target wasm32-unknown-unknown --release; the test fails!
Expected Behavior
The test should pass under both build profiles.
Actual Behavior
The test fails when building for release (a profile which, in this case, is configured with codegen-units = 1).
Additional Context
I worked backwards to codegen-units = 1 from the symptom of the problem: malformed JavaScript bindings.
In the passing case, the binding that affected me looks like this:
Note the getObject(arg0) instanceof Global check - the RHS of this should be WebAssembly.Global (as it is in the passing case). In the failing case, Global is undefined and the binding returns the wrong answer 😩
The text was updated successfully, but these errors were encountered:
Describe the Bug
The JavaScript binding for at least one API (
JsValue::is_instance_of::<WebAssembly::Global>()
) is malformed when building with a profile wherecodegen-units = 1
, changing its behavior across build profiles in unexpected ways.Steps to Reproduce
wasm-bindgen
-based projectcargo test --target wasm32-unknown-unknown
; the test will pass.cargo test --target wasm32-unknown-unknown --release
; the test fails!Expected Behavior
The test should pass under both build profiles.
Actual Behavior
The test fails when building for release (a profile which, in this case, is configured with
codegen-units = 1
).Additional Context
I worked backwards to
codegen-units = 1
from the symptom of the problem: malformed JavaScript bindings.In the passing case, the binding that affected me looks like this:
In the failing case, the binding looks like this:
Note the
getObject(arg0) instanceof Global
check - the RHS of this should beWebAssembly.Global
(as it is in the passing case). In the failing case,Global
is undefined and the binding returns the wrong answer 😩The text was updated successfully, but these errors were encountered: