Support #[wasm_bindgen(setter, js_name = ...)]

Previously we'd require the explicit `js_name` to *also* start with
`set_`, but when explicitly specified it shouldn't be mangled at all!

Closes #584
This commit is contained in:
Alex Crichton
2018-09-21 17:34:41 -07:00
parent 534cceafc8
commit 75f005be23
5 changed files with 20 additions and 8 deletions

View File

@ -689,6 +689,7 @@ fn function_from_decl(
ast::Function {
name: js_name.map(|s| s.0.to_string()).unwrap_or(decl_name.to_string()),
name_span: js_name.map(|s| s.1).unwrap_or(decl_name.span()),
renamed_via_js_name: js_name.is_some(),
arguments,
ret,
rust_vis: vis,