Fix codegen of consuming setters/getters (#2172)

Make sure they reset their internal pointer to null after we call Rust
since it invalidates the Rust pointer after being called!

Closes #2168
This commit is contained in:
Alex Crichton
2020-05-29 15:28:52 -05:00
committed by GitHub
parent b5e377da78
commit cc36bdc00d
7 changed files with 60 additions and 10 deletions

View File

@ -25,6 +25,14 @@ impl Fruit {
pub fn rot(self) {
drop(self);
}
#[wasm_bindgen(getter)]
pub fn prop(self) -> u32 {
0
}
#[wasm_bindgen(setter)]
pub fn set_prop(self, _val: u32) {}
}
#[wasm_bindgen]