mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-27 20:15:14 +03:00
backend: when complaining about setter names, show the name we are complaining about
This commit is contained in:
parent
178a5e89df
commit
016449ab3c
@ -346,7 +346,9 @@ impl ImportFunction {
|
||||
/// for a setter in javascript (in this case `xxx`, so you can write `obj.xxx = val`)
|
||||
fn infer_setter_property(&self) -> String {
|
||||
let name = self.function.name.to_string();
|
||||
assert!(name.starts_with("set_"), "setters must start with `set_`");
|
||||
if !name.starts_with("set_") {
|
||||
panic!("error: setters must start with `set_`, found: {}", name);
|
||||
}
|
||||
name[4..].to_string()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user