Repository: rustwasm/wasm-bindgen
Pull request #4299 (2024-11-29 15:30:24)

Removed a few `#[allow(dead_code)]`
Changes:

- Removed unused `nargs` field in `AuxImport::Closure`. The field wasn't used because the generated JS code used `...args` to capture any number of arguments. If this information is necessary in the future, `AuxImport::Closure` already includes the adapter ID of the closure function and the number of args can be retrieved from that.
- Removed unused `hole` field in `Instruction::OptionWasmToStringEnum`. The bindings have a comment explaining how the hole is handled implicitly as an "invalid" value, so it doesn't need to know the actual value of the hole.
- Changed how 8/16/32/64 bit ints are converted.

So about the integer conversion: Instead of removing the unused fields, I realized that `Instruction::IntToWasm` and `Instruction::WasmToInt` were kind of busted. The main issue is that they not only carried redundant data, but could also carry invalid data.

To fix this, I first split both into 64 and 32 variants. This immediately makes the JS -> WASM conversions nops. The WASM -> JS directions are also simpler, because they just need a single `bool` of data to select the correct conversion. 

This also fixes a minor bug in `representable_without_js_glue`. The function previously incorrectly determined that `WASM -> JS u64` and `WASM -> JS NonNull` did not require glue code. This was trivial to fix with the new representation.

---

This PR should not affect the output of the CLI in any way.


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 20a4fe37..bbadd8d9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,9 @@
 # `wasm-bindgen` Change Log
 --------------------------------------------------------------------------------
 
-## Unreleased
+## [0.2.96](https://github.com/rustwasm/wasm-bindgen/compare/0.2.95...0.2.96)
+
+Released 2024-11-29
 
 ### Added
 
diff --git a/Cargo.toml b/Cargo.toml
index 873238e5..79ce037b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ name = "wasm-bindgen"
 readme = "README.md"
 repository = "https://github.com/rustwasm/wasm-bindgen"
 rust-version = "1.57"
-version = "0.2.95"
+version = "0.2.96"
 
 [package.metadata.docs.rs]
 features = ["serde-serialize"]
@@ -45,15 +45,15 @@ cfg-if = "1.0.0"
 once_cell = { version = "1.12", default-features = false }
 serde = { version = "1.0", optional = true }
 serde_json = { version = "1.0", optional = true }
-wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.95", default-features = false }
+wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.96", default-features = false }
 
 [target.'cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"), target_feature = "atomics"))'.dependencies]
-wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.95", default-features = false, features = [
+wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.96", default-features = false, features = [
   "atomics",
 ] }
 
 [target.'cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"), wasm_bindgen_unstable_test_coverage))'.dependencies]
-wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.95", default-features = false, features = [
+wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.96", default-features = false, features = [
   "coverage",
 ] }
 
diff --git a/crates/backend/Cargo.toml b/crates/backend/Cargo.toml
index 50d744bb..207dac68 100644
--- a/crates/backend/Cargo.toml
+++ b/crates/backend/Cargo.toml
@@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-backend"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend"
 rust-version = "1.57"
-version = "0.2.95"
+version = "0.2.96"
 
 [features]
 atomics = []
@@ -28,7 +28,7 @@ once_cell = "1.12"
 proc-macro2 = "1.0"
 quote = '1.0'
 syn = { version = '2.0', features = ['full'] }
-wasm-bindgen-shared = { path = "../shared", version = "=0.2.95" }
+wasm-bindgen-shared = { path = "../shared", version = "=0.2.96" }
 
 [lints]
 workspace = true
diff --git a/crates/cli-support/Cargo.toml b/crates/cli-support/Cargo.toml
index 6eed3b63..f136e983 100644
--- a/crates/cli-support/Cargo.toml
+++ b/crates/cli-support/Cargo.toml
@@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-cli-support"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli-support"
 rust-version = "1.76"
-version = "0.2.95"
+version = "0.2.96"
 
 [dependencies]
 anyhow = "1.0"
@@ -23,12 +23,12 @@ serde_json = "1.0"
 tempfile = "3.0"
 unicode-ident = "1.0.5"
 walrus = "0.23"
-wasm-bindgen-externref-xform = { path = '../externref-xform', version = '=0.2.95' }
-wasm-bindgen-multi-value-xform = { path = '../multi-value-xform', version = '=0.2.95' }
-wasm-bindgen-shared = { path = "../shared", version = '=0.2.95' }
-wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.95' }
-wasm-bindgen-wasm-conventions = { path = '../wasm-conventions', version = '=0.2.95' }
-wasm-bindgen-wasm-interpreter = { path = "../wasm-interpreter", version = '=0.2.95' }
+wasm-bindgen-externref-xform = { path = '../externref-xform', version = '=0.2.96' }
+wasm-bindgen-multi-value-xform = { path = '../multi-value-xform', version = '=0.2.96' }
+wasm-bindgen-shared = { path = "../shared", version = '=0.2.96' }
+wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.96' }
+wasm-bindgen-wasm-conventions = { path = '../wasm-conventions', version = '=0.2.96' }
+wasm-bindgen-wasm-interpreter = { path = "../wasm-interpreter", version = '=0.2.96' }
 
 [lints]
 workspace = true
diff --git a/crates/cli-support/src/js/binding.rs b/crates/cli-support/src/js/binding.rs
index f79936e1..d5ed0136 100644
--- a/crates/cli-support/src/js/binding.rs
+++ b/crates/cli-support/src/js/binding.rs
@@ -704,28 +704,34 @@ fn instruction(
             }
         }
 
-        Instruction::IntToWasm { input, .. } => {
+        Instruction::Int32ToWasm => {
             let val = js.pop();
-            if matches!(
-                input,
-                AdapterType::I64 | AdapterType::S64 | AdapterType::U64
-            ) {
-                js.assert_bigint(&val);
+            js.assert_number(&val);
+            js.push(val);
+        }
+        Instruction::WasmToInt32 { unsigned_32 } => {
+            let val = js.pop();
+            if *unsigned_32 {
+                // When converting to a JS number we need to specially handle the `u32`
+                // case because if the high bit is set then it comes out as a negative
+                // number, but we want to switch that to an unsigned representation.
+                js.push(format!("{} >>> 0", val))
             } else {
-                js.assert_number(&val);
+                js.push(val)
             }
-            js.push(val);
         }
 
-        // When converting to a JS number we need to specially handle the `u32`
-        // case because if the high bit is set then it comes out as a negative
-        // number, but we want to switch that to an unsigned representation.
-        Instruction::WasmToInt { output, .. } => {
+        Instruction::Int64ToWasm => {
             let val = js.pop();
-            match output {
-                AdapterType::U32 | AdapterType::NonNull => js.push(format!("{} >>> 0", val)),
-                AdapterType::U64 => js.push(format!("BigInt.asUintN(64, {val})")),
-                _ => js.push(val),
+            js.assert_bigint(&val);
+            js.push(val);
+        }
+        Instruction::WasmToInt64 { unsigned } => {
+            let val = js.pop();
+            if *unsigned {
+                js.push(format!("BigInt.asUintN(64, {val})"))
+            } else {
+                js.push(val)
             }
         }
 
@@ -765,7 +771,7 @@ fn instruction(
             js.push(wasm_to_string_enum(name, &index))
         }
 
-        Instruction::OptionWasmToStringEnum { name, .. } => {
+        Instruction::OptionWasmToStringEnum { name } => {
             // Since hole is currently variant_count+1 and the lookup is
             // ["a","b","c"][index], the lookup will implicitly return map
             // the hole to undefined, because OOB indexes will return undefined.
diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs
index babbfc09..72b0273d 100644
--- a/crates/cli-support/src/js/mod.rs
+++ b/crates/cli-support/src/js/mod.rs
@@ -1,8 +1,8 @@
 use crate::descriptor::VectorKind;
 use crate::intrinsic::Intrinsic;
 use crate::wit::{
-    Adapter, AdapterId, AdapterJsImportKind, AdapterType, AuxExportedMethodKind, AuxReceiverKind,
-    AuxStringEnum, AuxValue,
+    Adapter, AdapterId, AdapterJsImportKind, AuxExportedMethodKind, AuxReceiverKind, AuxStringEnum,
+    AuxValue,
 };
 use crate::wit::{AdapterKind, Instruction, InstructionData};
 use crate::wit::{AuxEnum, AuxExport, AuxExportKind, AuxImport, AuxStruct};
@@ -3119,16 +3119,14 @@ __wbg_set_wasm(wasm);"
 
                 // Conversions to Wasm integers are always supported since
                 // they're coerced into i32/f32/f64 appropriately.
-                IntToWasm { .. } => {}
+                Int32ToWasm => {}
+                Int64ToWasm => {}
 
-                // Converts from Wasm to JS, however, only supports most
-                // integers. Converting into a u32 isn't supported because we
+                // Converting into a u32 isn't supported because we
                 // need to generate glue to change the sign.
-                WasmToInt {
-                    output: AdapterType::U32,
-                    ..
-                } => return false,
-                WasmToInt { .. } => {}
+                WasmToInt32 { unsigned_32: false } => {}
+                // A Wasm `i64` is already a signed JS BigInt, so no glue needed.
+                WasmToInt64 { unsigned: false } => {}
 
                 // JS spec automatically coerces boolean values to i32 of 0 or 1
                 // depending on true/false
@@ -3279,7 +3277,6 @@ __wbg_set_wasm(wasm);"
                 dtor,
                 mutable,
                 adapter,
-                nargs: _,
             } => {
                 assert!(kind == AdapterJsImportKind::Normal);
                 assert!(!variadic);
diff --git a/crates/cli-support/src/wit/incoming.rs b/crates/cli-support/src/wit/incoming.rs
index c0ad9ad3..0309ef8c 100644
--- a/crates/cli-support/src/wit/incoming.rs
+++ b/crates/cli-support/src/wit/incoming.rs
@@ -43,7 +43,6 @@ impl InstructionBuilder<'_, '_> {
     }
 
     fn _incoming(&mut self, arg: &Descriptor) -> Result<(), Error> {
-        use walrus::ValType as WasmVT;
         match arg {
             Descriptor::Boolean => {
                 self.instruction(
@@ -82,14 +81,14 @@ impl InstructionBuilder<'_, '_> {
                     &[AdapterType::I32],
                 );
             }
-            Descriptor::I8 => self.number(AdapterType::S8, WasmVT::I32),
-            Descriptor::U8 => self.number(AdapterType::U8, WasmVT::I32),
-            Descriptor::I16 => self.number(AdapterType::S16, WasmVT::I32),
-            Descriptor::U16 => self.number(AdapterType::U16, WasmVT::I32),
-            Descriptor::I32 => self.number(AdapterType::S32, WasmVT::I32),
-            Descriptor::U32 => self.number(AdapterType::U32, WasmVT::I32),
-            Descriptor::I64 => self.number(AdapterType::S64, WasmVT::I64),
-            Descriptor::U64 => self.number(AdapterType::U64, WasmVT::I64),
+            Descriptor::I8 => self.number_i32(AdapterType::S8),
+            Descriptor::U8 => self.number_i32(AdapterType::U8),
+            Descriptor::I16 => self.number_i32(AdapterType::S16),
+            Descriptor::U16 => self.number_i32(AdapterType::U16),
+            Descriptor::I32 => self.number_i32(AdapterType::S32),
+            Descriptor::U32 => self.number_i32(AdapterType::U32),
+            Descriptor::I64 => self.number_i64(AdapterType::S64),
+            Descriptor::U64 => self.number_i64(AdapterType::U64),
             Descriptor::I128 => {
                 self.instruction(
                     &[AdapterType::S128],
@@ -115,10 +114,7 @@ impl InstructionBuilder<'_, '_> {
             Descriptor::Enum { name, .. } => {
                 self.instruction(
                     &[AdapterType::Enum(name.clone())],
-                    Instruction::IntToWasm {
-                        input: AdapterType::U32,
-                        output: ValType::I32,
-                    },
+                    Instruction::Int32ToWasm,
                     &[AdapterType::I32],
                 );
             },
@@ -470,12 +466,11 @@ impl InstructionBuilder<'_, '_> {
         self.output.extend_from_slice(outputs);
     }
 
-    fn number(&mut self, input: AdapterType, output: walrus::ValType) {
-        let instr = Instruction::IntToWasm {
-            input: input.clone(),
-            output,
-        };
-        self.instruction(&[input], instr, &[AdapterType::from_wasm(output).unwrap()]);
+    fn number_i32(&mut self, input: AdapterType) {
+        self.instruction(&[input], Instruction::Int32ToWasm, &[AdapterType::I32]);
+    }
+    fn number_i64(&mut self, input: AdapterType) {
+        self.instruction(&[input], Instruction::Int64ToWasm, &[AdapterType::I64]);
     }
 
     fn in_option_native(&mut self, wasm: ValType) {
diff --git a/crates/cli-support/src/wit/mod.rs b/crates/cli-support/src/wit/mod.rs
index 07a09860..2f1d7f52 100644
--- a/crates/cli-support/src/wit/mod.rs
+++ b/crates/cli-support/src/wit/mod.rs
@@ -197,7 +197,6 @@ impl<'a> Context<'a> {
                 // aren't present in the signature but are present in the wasm
                 // signature.
                 let mut function = descriptor.function.clone();
-                let nargs = function.arguments.len();
                 function.arguments.insert(0, Descriptor::I32);
                 function.arguments.insert(0, Descriptor::I32);
                 let adapter = self.table_element_adapter(descriptor.shim_idx, function)?;
@@ -206,7 +205,6 @@ impl<'a> Context<'a> {
                     AuxImport::Closure {
                         dtor: descriptor.dtor_idx,
                         mutable: descriptor.mutable,
-                        nargs,
                         adapter,
                     },
                 );
diff --git a/crates/cli-support/src/wit/nonstandard.rs b/crates/cli-support/src/wit/nonstandard.rs
index 4ff93298..35f30a74 100644
--- a/crates/cli-support/src/wit/nonstandard.rs
+++ b/crates/cli-support/src/wit/nonstandard.rs
@@ -241,11 +241,12 @@ pub enum AuxImport {
     /// This import is intended to manufacture a JS closure with the given
     /// signature and then return that back to Rust.
     Closure {
-        mutable: bool,      // whether or not this was a `FnMut` closure
-        dtor: u32,          // table element index of the destructor function
-        adapter: AdapterId, // the adapter which translates the types for this closure
-        #[allow(dead_code)]
-        nargs: usize,
+        /// whether or not this was a `FnMut` closure
+        mutable: bool,
+        /// table element index of the destructor function
+        dtor: u32,
+        /// the adapter which translates the types for this closure
+        adapter: AdapterId,
     },
 
     /// This import is expected to be a shim that simply calls the `foo` method
diff --git a/crates/cli-support/src/wit/outgoing.rs b/crates/cli-support/src/wit/outgoing.rs
index 2e34dd0d..ba15babf 100644
--- a/crates/cli-support/src/wit/outgoing.rs
+++ b/crates/cli-support/src/wit/outgoing.rs
@@ -316,13 +316,10 @@ impl InstructionBuilder<'_, '_> {
                     &[AdapterType::Enum(name.clone()).option()],
                 );
             }
-            Descriptor::StringEnum { name, hole, .. } => {
+            Descriptor::StringEnum { name, .. } => {
                 self.instruction(
                     &[AdapterType::I32],
-                    Instruction::OptionWasmToStringEnum {
-                        name: name.clone(),
-                        hole: *hole,
-                    },
+                    Instruction::OptionWasmToStringEnum { name: name.clone() },
                     &[AdapterType::StringEnum(name.clone()).option()],
                 );
             }
@@ -554,14 +551,6 @@ impl InstructionBuilder<'_, '_> {
         Ok(())
     }
 
-    fn outgoing_i32(&mut self, output: AdapterType) {
-        let instr = Instruction::WasmToInt {
-            input: walrus::ValType::I32,
-            output: output.clone(),
-        };
-        self.instruction(&[AdapterType::I32], instr, &[output]);
-    }
-
     fn outgoing_string_enum(&mut self, name: &str) {
         self.instruction(
             &[AdapterType::I32],
@@ -572,10 +561,15 @@ impl InstructionBuilder<'_, '_> {
         );
     }
 
+    fn outgoing_i32(&mut self, output: AdapterType) {
+        let instr = Instruction::WasmToInt32 {
+            unsigned_32: output == AdapterType::U32 || output == AdapterType::NonNull,
+        };
+        self.instruction(&[AdapterType::I32], instr, &[output]);
+    }
     fn outgoing_i64(&mut self, output: AdapterType) {
-        let instr = Instruction::WasmToInt {
-            input: walrus::ValType::I64,
-            output: output.clone(),
+        let instr = Instruction::WasmToInt64 {
+            unsigned: output == AdapterType::U64,
         };
         self.instruction(&[AdapterType::I64], instr, &[output]);
     }
diff --git a/crates/cli-support/src/wit/standard.rs b/crates/cli-support/src/wit/standard.rs
index e34866d2..b0b1cb68 100644
--- a/crates/cli-support/src/wit/standard.rs
+++ b/crates/cli-support/src/wit/standard.rs
@@ -137,17 +137,19 @@ pub enum Instruction {
         size: u32,
     },
 
-    /// Pops a typed integer (`u8`, `s16`, etc.) and pushes a plain Wasm `i32` or `i64` equivalent.
-    IntToWasm {
-        input: AdapterType,
-        #[allow(dead_code)]
-        output: walrus::ValType,
+    /// Pops a 32/16/8-bit integer (`u8`, `s16`, etc.) and pushes a Wasm `i32`.
+    Int32ToWasm,
+    /// Pops a Wasm `i32` and pushes a 32-bit integer.
+    WasmToInt32 {
+        /// Whether the integer represents an unsigned 32-bit value.
+        unsigned_32: bool,
     },
-    /// Pops a Wasm `i32` or `i64` and pushes a typed integer (`u8`, `s16`, etc.) equivalent.
-    WasmToInt {
-        #[allow(dead_code)]
-        input: walrus::ValType,
-        output: AdapterType,
+
+    /// Pops a 64-bit integer and pushes a Wasm `i64`.
+    Int64ToWasm,
+    /// Pops a Wasm `i64` and pushes a 64-bit integer.
+    WasmToInt64 {
+        unsigned: bool,
     },
 
     /// Pops a 128-bit integer and pushes 2 Wasm 64-bit ints.
@@ -169,8 +171,6 @@ pub enum Instruction {
 
     OptionWasmToStringEnum {
         name: String,
-        #[allow(dead_code)]
-        hole: u32,
     },
 
     /// pops a string and pushes the enum variant as an `i32`
diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml
index 4ee94630..f16b5b68 100644
--- a/crates/cli/Cargo.toml
+++ b/crates/cli/Cargo.toml
@@ -14,7 +14,7 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-cli"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli"
 rust-version = "1.76"
-version = "0.2.95"
+version = "0.2.96"
 
 [package.metadata.binstall]
 bin-dir = "wasm-bindgen-{ version }-{ target }/{ bin }{ binary-ext }"
@@ -32,8 +32,8 @@ serde_derive = "1.0"
 serde_json = "1.0"
 ureq = { version = "2.7", default-features = false, features = ["brotli", "gzip"] }
 walrus = { version = "0.23", features = ['parallel'] }
-wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.95" }
-wasm-bindgen-shared = { path = "../shared", version = "=0.2.95" }
+wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.96" }
+wasm-bindgen-shared = { path = "../shared", version = "=0.2.96" }
 
 [dev-dependencies]
 assert_cmd = "2"
diff --git a/crates/externref-xform/Cargo.toml b/crates/externref-xform/Cargo.toml
index ae4dc7f0..4615e53b 100644
--- a/crates/externref-xform/Cargo.toml
+++ b/crates/externref-xform/Cargo.toml
@@ -11,12 +11,12 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-externref-xform"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/externref-xform"
 rust-version = "1.76"
-version = "0.2.95"
+version = "0.2.96"
 
 [dependencies]
 anyhow = "1.0"
 walrus = "0.23"
-wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.95" }
+wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.96" }
 
 [dev-dependencies]
 rayon = "1.0"
diff --git a/crates/futures/Cargo.toml b/crates/futures/Cargo.toml
index d748c4a1..c3257bb8 100644
--- a/crates/futures/Cargo.toml
+++ b/crates/futures/Cargo.toml
@@ -10,7 +10,7 @@ name = "wasm-bindgen-futures"
 readme = "./README.md"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/futures"
 rust-version = "1.57"
-version = "0.4.45"
+version = "0.4.46"
 
 [package.metadata.docs.rs]
 all-features = true
@@ -19,20 +19,20 @@ rustdoc-args = ["--cfg", "docsrs"]
 [dependencies]
 cfg-if = "1.0.0"
 futures-core = { version = '0.3.8', default-features = false, optional = true }
-js-sys = { path = "../js-sys", version = '=0.3.72', default-features = false }
+js-sys = { path = "../js-sys", version = '=0.3.73', default-features = false }
 once_cell = { version = "1.12", default-features = false }
-wasm-bindgen = { path = "../..", version = '=0.2.95', default-features = false }
+wasm-bindgen = { path = "../..", version = '=0.2.96', default-features = false }
 
 [features]
 default = ["std"]
 futures-core-03-stream = ['futures-core']
 std = ["wasm-bindgen/std", "js-sys/std", "web-sys/std", "once_cell/std"]
 
-[target.'cfg(target_feature = "atomics")'.dependencies.web-sys]
-default-features = false
-features = ["MessageEvent", "Worker"]
-path = "../web-sys"
-version = "=0.3.72"
+[target.'cfg(target_feature = "atomics")'.dependencies]
+web-sys = { path = "../web-sys", version = "=0.3.73", default-features = false, features = [
+  "MessageEvent",
+  "Worker",
+] }
 
 [target.'cfg(target_arch = "wasm32")'.dev-dependencies]
 futures-channel-preview = { version = "0.3.0-alpha.18" }
diff --git a/crates/js-sys/Cargo.toml b/crates/js-sys/Cargo.toml
index 466598c4..62159e87 100644
--- a/crates/js-sys/Cargo.toml
+++ b/crates/js-sys/Cargo.toml
@@ -14,7 +14,7 @@ name = "js-sys"
 readme = "./README.md"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/js-sys"
 rust-version = "1.57"
-version = "0.3.72"
+version = "0.3.73"
 
 [lib]
 doctest = false
@@ -25,7 +25,7 @@ default = ["std"]
 std = ["wasm-bindgen/std"]
 
 [dependencies]
-wasm-bindgen = { path = "../..", version = "=0.2.95", default-features = false }
+wasm-bindgen = { path = "../..", version = "=0.2.96", default-features = false }
 
 [target.'cfg(target_arch = "wasm32")'.dev-dependencies]
 wasm-bindgen-futures = { path = '../futures' }
diff --git a/crates/macro-support/Cargo.toml b/crates/macro-support/Cargo.toml
index f9f024ac..9165e959 100644
--- a/crates/macro-support/Cargo.toml
+++ b/crates/macro-support/Cargo.toml
@@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-macro-support"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro-support"
 rust-version = "1.57"
-version = "0.2.95"
+version = "0.2.96"
 
 [features]
 atomics = ["wasm-bindgen-backend/atomics"]
@@ -26,8 +26,8 @@ strict-macro = []
 proc-macro2 = "1.0"
 quote = '1.0'
 syn = { version = '2.0', features = ['visit', 'visit-mut', 'full'] }
-wasm-bindgen-backend = { path = "../backend", version = "=0.2.95", default-features = false }
-wasm-bindgen-shared = { path = "../shared", version = "=0.2.95" }
+wasm-bindgen-backend = { path = "../backend", version = "=0.2.96", default-features = false }
+wasm-bindgen-shared = { path = "../shared", version = "=0.2.96" }
 
 [lints]
 workspace = true
diff --git a/crates/macro/Cargo.toml b/crates/macro/Cargo.toml
index bf6c7690..10001c05 100644
--- a/crates/macro/Cargo.toml
+++ b/crates/macro/Cargo.toml
@@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-macro"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro"
 rust-version = "1.57"
-version = "0.2.95"
+version = "0.2.96"
 
 [lib]
 proc-macro = true
@@ -27,7 +27,7 @@ xxx_debug_only_print_generated_code = []
 
 [dependencies]
 quote = "1.0"
-wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.95", default-features = false }
+wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.96", default-features = false }
 
 [dev-dependencies]
 js-sys = { path = "../js-sys" }
diff --git a/crates/multi-value-xform/Cargo.toml b/crates/multi-value-xform/Cargo.toml
index 05d176cf..9457b807 100644
--- a/crates/multi-value-xform/Cargo.toml
+++ b/crates/multi-value-xform/Cargo.toml
@@ -11,12 +11,12 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-multi-value-xform"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/multi-value-xform"
 rust-version = "1.76"
-version = "0.2.95"
+version = "0.2.96"
 
 [dependencies]
 anyhow = "1.0"
 walrus = "0.23"
-wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.95" }
+wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.96" }
 
 [dev-dependencies]
 rayon = "1.0"
diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml
index 3cc734b7..168898fd 100644
--- a/crates/shared/Cargo.toml
+++ b/crates/shared/Cargo.toml
@@ -12,7 +12,7 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-shared"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/shared"
 rust-version = "1.57"
-version = "0.2.95"
+version = "0.2.96"
 
 # Because only a single `wasm_bindgen` version can be used in a dependency
 # graph, pretend we link a native library so that `cargo` will provide better
diff --git a/crates/shared/src/lib.rs b/crates/shared/src/lib.rs
index 13b893e4..cee84307 100644
--- a/crates/shared/src/lib.rs
+++ b/crates/shared/src/lib.rs
@@ -6,7 +6,7 @@ mod schema_hash_approval;
 // This gets changed whenever our schema changes.
 // At this time versions of wasm-bindgen and wasm-bindgen-cli are required to have the exact same
 // SCHEMA_VERSION in order to work together.
-pub const SCHEMA_VERSION: &str = "0.2.95";
+pub const SCHEMA_VERSION: &str = "0.2.96";
 
 #[macro_export]
 macro_rules! shared_api {
diff --git a/crates/shared/src/schema_hash_approval.rs b/crates/shared/src/schema_hash_approval.rs
index ebc7341b..fa086937 100644
--- a/crates/shared/src/schema_hash_approval.rs
+++ b/crates/shared/src/schema_hash_approval.rs
@@ -8,7 +8,7 @@
 // If the schema in this library has changed then:
 //  1. Bump the version in `crates/shared/Cargo.toml`
 //  2. Change the `SCHEMA_VERSION` in this library to this new Cargo.toml version
-const APPROVED_SCHEMA_FILE_HASH: &str = "211103844299778814";
+const APPROVED_SCHEMA_FILE_HASH: &str = "8234561557367848394";
 
 #[test]
 fn schema_version() {
diff --git a/crates/threads-xform/Cargo.toml b/crates/threads-xform/Cargo.toml
index b65754be..d055fb24 100644
--- a/crates/threads-xform/Cargo.toml
+++ b/crates/threads-xform/Cargo.toml
@@ -11,12 +11,12 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-threads-xform"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/threads-xform"
 rust-version = "1.76"
-version = "0.2.95"
+version = "0.2.96"
 
 [dependencies]
 anyhow = "1.0"
 walrus = "0.23"
-wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.95" }
+wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.96" }
 
 [dev-dependencies]
 rayon = "1.0"
diff --git a/crates/wasm-conventions/Cargo.toml b/crates/wasm-conventions/Cargo.toml
index 66ec85f8..3f16295f 100644
--- a/crates/wasm-conventions/Cargo.toml
+++ b/crates/wasm-conventions/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-wasm-conventions"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/wasm-conventions"
 rust-version = "1.76"
-version = "0.2.95"
+version = "0.2.96"
 
 [dependencies]
 leb128 = "0.2"
diff --git a/crates/wasm-interpreter/Cargo.toml b/crates/wasm-interpreter/Cargo.toml
index 8c5f1b1d..efb22bd8 100644
--- a/crates/wasm-interpreter/Cargo.toml
+++ b/crates/wasm-interpreter/Cargo.toml
@@ -11,13 +11,13 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-wasm-interpreter"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/main/crates/wasm-interpreter"
 rust-version = "1.76"
-version = "0.2.95"
+version = "0.2.96"
 
 [dependencies]
 anyhow = "1.0"
 log = "0.4"
 walrus = "0.23"
-wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "0.2.95" }
+wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "0.2.96" }
 
 [dev-dependencies]
 tempfile = "3"
diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml
index 52551c61..df11949d 100644
--- a/crates/web-sys/Cargo.toml
+++ b/crates/web-sys/Cargo.toml
@@ -12,7 +12,7 @@ name = "web-sys"
 readme = "./README.md"
 repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys"
 rust-version = "1.57"
-version = "0.3.72"
+version = "0.3.73"
 
 [package.metadata.docs.rs]
 all-features = true
@@ -23,8 +23,8 @@ doctest = false
 test = false
 
 [dependencies]
-js-sys = { path = '../js-sys', version = '=0.3.72', default-features = false }
-wasm-bindgen = { path = "../..", version = "=0.2.95", default-features = false }
+js-sys = { path = '../js-sys', version = '=0.3.73', default-features = false }
+wasm-bindgen = { path = "../..", version = "=0.2.96", default-features = false }
 
 [target.'cfg(target_arch = "wasm32")'.dev-dependencies]
 futures = "0.3"


Test patch:
diff --git a/crates/cli/tests/reference/web-sys.js b/crates/cli/tests/reference/web-sys.js
index 915a0941..99886e52 100644
--- a/crates/cli/tests/reference/web-sys.js
+++ b/crates/cli/tests/reference/web-sys.js
@@ -188,7 +188,7 @@ export function get_media_source() {
 
 const __wbindgen_enum_MediaSourceEnum = ["camera", "screen", "application", "window", "browser", "microphone", "audioCapture", "other"];
 
-export function __wbg_new_561a91ce53f10a66() { return handleError(function (arg0, arg1) {
+export function __wbg_new_dce808fb3f528314() { return handleError(function (arg0, arg1) {
     const ret = new URL(getStringFromWasm0(arg0, arg1));
     return ret;
 }, arguments) };
diff --git a/crates/test-macro/Cargo.toml b/crates/test-macro/Cargo.toml
index 1d0ecab4..6428ec85 100644
--- a/crates/test-macro/Cargo.toml
+++ b/crates/test-macro/Cargo.toml
@@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-test-macro"
 repository = "https://github.com/rustwasm/wasm-bindgen"
 rust-version = "1.57"
-version = "0.3.45"
+version = "0.3.46"
 
 [lib]
 proc-macro = true
diff --git a/crates/test/Cargo.toml b/crates/test/Cargo.toml
index fccd1b96..6140a3d5 100644
--- a/crates/test/Cargo.toml
+++ b/crates/test/Cargo.toml
@@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
 name = "wasm-bindgen-test"
 repository = "https://github.com/rustwasm/wasm-bindgen"
 rust-version = "1.57"
-version = "0.3.45"
+version = "0.3.46"
 
 [features]
 default = ["std"]
@@ -15,16 +15,16 @@ std = ["wasm-bindgen/std", "js-sys/std", "wasm-bindgen-futures/std", "once_cell/
 
 [dependencies]
 gg-alloc = { version = "1.0", optional = true }
-js-sys = { path = '../js-sys', version = '=0.3.72', default-features = false }
+js-sys = { path = '../js-sys', version = '=0.3.73', default-features = false }
 once_cell = { version = "1.12", default-features = false }
 scoped-tls = { version = "1.0", optional = true }
-wasm-bindgen = { path = '../..', version = '=0.2.95', default-features = false }
-wasm-bindgen-futures = { path = '../futures', version = '=0.4.45', default-features = false }
-wasm-bindgen-test-macro = { path = '../test-macro', version = '=0.3.45' }
+wasm-bindgen = { path = '../..', version = '=0.2.96', default-features = false }
+wasm-bindgen-futures = { path = '../futures', version = '=0.4.46', default-features = false }
+wasm-bindgen-test-macro = { path = '../test-macro', version = '=0.3.46' }
 
 [target.'cfg(all(target_arch = "wasm32", wasm_bindgen_unstable_test_coverage))'.dependencies]
 minicov = "0.3"
-wasm-bindgen-test-macro = { path = '../test-macro', version = '=0.3.45', features = ["coverage"] }
+wasm-bindgen-test-macro = { path = '../test-macro', version = '=0.3.46', features = ["coverage"] }
 
 [lints.rust]
 unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }