mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-05-07 19:42:16 +00:00
Merge pull request #1544 from ibaryshnikov/master
expose forget to wasm
This commit is contained in:
commit
f23b867179
@ -249,7 +249,7 @@ impl<'a> Context<'a> {
|
||||
format!("{}{}\n", export, contents)
|
||||
} else {
|
||||
assert_eq!(export_name, definition_name);
|
||||
format!("{}const {} = {};\n", export, export_name, contents)
|
||||
format!("{}const {name} = {};\n__exports.{name} = {name};", export, contents, name = export_name)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user