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

@ -33,4 +33,11 @@ exports.js_works = () => {
useMoved();
moveMoved();
methodMoved();
const a = new wasm.Fruit('a');
a.prop;
assertMovedPtrThrows(() => a.prop);
const b = new wasm.Fruit('a');
b.prop = 3;
assertMovedPtrThrows(() => { b.prop = 4; });
};