From 7b9fc4f04386f6cbbb1c89449dfa6d535ab3b178 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 11 Nov 2023 21:50:00 -0600 Subject: [PATCH 1/3] __wbindgen_thread_destroy has optional args --- crates/cli-support/src/wasm2es6js.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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"); } From 50844df39d28e99d4178dd207a1ecc10d61f624e Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 15 Nov 2023 15:58:07 -0600 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62f8afabe59..d536d1c8ed1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,15 @@ * Add additional constructor to `DataView` for `SharedArrayBuffer`. [#3695](https://github.com/rustwasm/wasm-bindgen/pull/3695) +* Remove experimental status from `wasm_bindgen::module()` and update docs to say it works with `--target web`. + [#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 has optional parameters. + [#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) From 41231502028049c2d58cd7aa056e9bab05bbdad8 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Wed, 15 Nov 2023 23:04:18 +0100 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d536d1c8ed1..c45e8a41ae0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,14 +7,16 @@ * Add additional constructor to `DataView` for `SharedArrayBuffer`. [#3695](https://github.com/rustwasm/wasm-bindgen/pull/3695) -* Remove experimental status from `wasm_bindgen::module()` and update docs to say it works with `--target web`. + +* 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 has optional parameters. + +* 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)