Add a test that Callback::forget works

This commit is contained in:
Alex Crichton 2019-05-20 09:32:37 -07:00
parent 805738608d
commit a68cdc594d

View File

@ -51,3 +51,11 @@ pub mod snippets;
pub mod modules;
pub mod anyref_heap_live_count;
pub mod strings;
#[wasm_bindgen_test]
fn closures_work() {
let x = Closure::wrap(Box::new(|| {}) as Box<FnMut()>);
drop(x);
let x = Closure::wrap(Box::new(|| {}) as Box<FnMut()>);
x.forget();
}