mirror of
https://github.com/tlsnotary/wasm-bindgen.git
synced 2026-01-09 15:08:01 -05:00
committed by
GitHub
parent
b4da51c4b1
commit
5767be9ea0
@@ -5,6 +5,10 @@
|
||||
|
||||
### Added
|
||||
|
||||
* Allow exporting functions named `default`. Throw error in wasm-bindgen-cli if --target web and
|
||||
an exported symbol is named `default`.
|
||||
[#3930](https://github.com/rustwasm/wasm-bindgen/pull/3930)
|
||||
|
||||
* Added support for arbitrary expressions when using `#[wasm_bindgen(typescript_custom_section)]`.
|
||||
[#3901](https://github.com/rustwasm/wasm-bindgen/pull/3901)
|
||||
|
||||
|
||||
@@ -327,6 +327,13 @@ impl Bindgen {
|
||||
.context("failed getting Wasm module")?,
|
||||
};
|
||||
|
||||
// Check that no exported symbol is called "default" if we target web.
|
||||
if matches!(self.mode, OutputMode::Web)
|
||||
&& module.exports.iter().any(|export| export.name == "default")
|
||||
{
|
||||
bail!("exported symbol \"default\" not allowed for --target web")
|
||||
}
|
||||
|
||||
let thread_count = self
|
||||
.threads
|
||||
.run(&mut module)
|
||||
|
||||
@@ -799,7 +799,7 @@ impl ConvertToAst<BindgenAttrs> for syn::ItemFn {
|
||||
false,
|
||||
None,
|
||||
false,
|
||||
None,
|
||||
Some(&["default"]),
|
||||
)?;
|
||||
attrs.check_used();
|
||||
Ok(ret.0)
|
||||
|
||||
Reference in New Issue
Block a user