diff --git a/CHANGELOG.md b/CHANGELOG.md index 62f8afabe59..c45e8a41ae0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,17 @@ * Add additional constructor to `DataView` for `SharedArrayBuffer`. [#3695](https://github.com/rustwasm/wasm-bindgen/pull/3695) +* Stabilize `wasm_bindgen::module()`. + [#3690](https://github.com/rustwasm/wasm-bindgen/pull/3690) + ### Fixed * The DWARF section is now correctly modified instead of leaving it in a broken state. [#3483](https://github.com/rustwasm/wasm-bindgen/pull/3483) +* Update the TypeScript signature of `__wbindgen_thread_destroy` to indicate that it's parameters are optional. + [#3703](https://github.com/rustwasm/wasm-bindgen/pull/3703) + ## [0.2.88](https://github.com/rustwasm/wasm-bindgen/compare/0.2.87...0.2.88) Released 2023-11-01 diff --git a/crates/cli-support/src/wasm2es6js.rs b/crates/cli-support/src/wasm2es6js.rs index 9dc42f9d4c6..981dce62952 100644 --- a/crates/cli-support/src/wasm2es6js.rs +++ b/crates/cli-support/src/wasm2es6js.rs @@ -55,6 +55,10 @@ fn push_index_identifier(i: usize, s: &mut String) { } } +fn args_are_optional(name: &str) -> bool { + name == "__wbindgen_thread_destroy" +} + pub fn interface(module: &Module) -> Result { let mut exports = String::new(); @@ -81,6 +85,9 @@ pub fn interface(module: &Module) -> Result { } push_index_identifier(i, &mut args); + if args_are_optional(&entry.name) { + args.push('?'); + } args.push_str(": number"); }