File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
crates/cli-support/src/js Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 70
70
* Fixed ` no_std ` support for all APIs in ` web-sys ` .
71
71
[ #4378 ] ( https://github.com/rustwasm/wasm-bindgen/pull/4378 )
72
72
73
+ * Prevent generating duplicate exports for closure conversions.
74
+ [ #4380 ] ( https://github.com/rustwasm/wasm-bindgen/pull/4380 )
75
+
73
76
--------------------------------------------------------------------------------
74
77
75
78
## [ 0.2.99] ( https://github.com/rustwasm/wasm-bindgen/compare/0.2.98...0.2.99 )
Original file line number Diff line number Diff line change @@ -4270,8 +4270,18 @@ __wbg_set_wasm(wasm);"
4270
4270
"memory" . to_owned ( )
4271
4271
}
4272
4272
walrus:: ExportItem :: Function ( f) => match & self . module . funcs . get ( f) . name {
4273
- Some ( s) => to_js_identifier ( s) ,
4274
- None => default_name,
4273
+ Some ( s) => {
4274
+ let mut name = to_js_identifier ( s) ;
4275
+
4276
+ // Account for duplicate export names.
4277
+ // See https://github.com/rustwasm/wasm-bindgen/issues/4371.
4278
+ if self . module . exports . get_func ( & name) . is_ok ( ) {
4279
+ name. push_str ( & self . next_export_idx . to_string ( ) ) ;
4280
+ }
4281
+
4282
+ name
4283
+ }
4284
+ _ => default_name,
4275
4285
} ,
4276
4286
_ => default_name,
4277
4287
} ;
You can’t perform that action at this time.
0 commit comments