mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Don't generate a free function shim for classes
This was once required due to flavorful management of the `WeakRef` proposal but nowadays it's simple enough that we don't need to refactor it out here.
This commit is contained in:
parent
6e8c3e88f8
commit
bf1a31e139
@ -571,26 +571,17 @@ impl<'a> Context<'a> {
|
||||
));
|
||||
}
|
||||
|
||||
self.global(&format!(
|
||||
"
|
||||
function free{}(ptr) {{
|
||||
wasm.{}(ptr);
|
||||
}}
|
||||
",
|
||||
name,
|
||||
wasm_bindgen_shared::free_function(&name)
|
||||
));
|
||||
|
||||
if self.config.weak_refs {
|
||||
self.global(&format!(
|
||||
"
|
||||
const {}FinalizationGroup = new FinalizationGroup((items) => {{
|
||||
for (const ptr of items) {{
|
||||
free{}(ptr);
|
||||
wasm.{}(ptr);
|
||||
}}
|
||||
}});
|
||||
",
|
||||
name, name,
|
||||
name,
|
||||
wasm_bindgen_shared::free_function(&name),
|
||||
));
|
||||
}
|
||||
|
||||
@ -600,7 +591,7 @@ impl<'a> Context<'a> {
|
||||
const ptr = this.ptr;
|
||||
this.ptr = 0;
|
||||
{}
|
||||
free{}(ptr);
|
||||
wasm.{}(ptr);
|
||||
}}
|
||||
",
|
||||
if self.config.weak_refs {
|
||||
@ -608,7 +599,7 @@ impl<'a> Context<'a> {
|
||||
} else {
|
||||
String::new()
|
||||
},
|
||||
name,
|
||||
wasm_bindgen_shared::free_function(&name),
|
||||
));
|
||||
ts_dst.push_str(" free(): void;");
|
||||
dst.push_str(&class.contents);
|
||||
|
Loading…
x
Reference in New Issue
Block a user