mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Improve consistency of prefixes
This commit is contained in:
parent
d3387d591f
commit
91fddfd10f
@ -363,11 +363,11 @@ impl Js {
|
||||
typescript_imports.push_str("\n");
|
||||
}
|
||||
|
||||
if self.wasm_import_needed("__wasm_bindgen_object_clone_ref", m) {
|
||||
if self.wasm_import_needed("__wbindgen_object_clone_ref", m) {
|
||||
self.expose_add_heap_object();
|
||||
self.expose_get_object();
|
||||
imports.push_str("
|
||||
__wasm_bindgen_object_clone_ref: function(idx: number): number {
|
||||
__wbindgen_object_clone_ref: function(idx: number): number {
|
||||
// If this object is on the stack promote it to the heap.
|
||||
if ((idx & 1) === 1) {
|
||||
return addHeapObject(getObject(idx));
|
||||
@ -384,9 +384,9 @@ impl Js {
|
||||
");
|
||||
}
|
||||
|
||||
if self.wasm_import_needed("__wasm_bindgen_object_drop_ref", m) {
|
||||
if self.wasm_import_needed("__wbindgen_object_drop_ref", m) {
|
||||
self.expose_drop_ref();
|
||||
imports.push_str("__wasm_bindgen_object_drop_ref: dropRef,\n");
|
||||
imports.push_str("__wbindgen_object_drop_ref: dropRef,\n");
|
||||
}
|
||||
|
||||
if self.wasm_import_needed("__wbindgen_throw", m) {
|
||||
|
@ -33,14 +33,14 @@ impl JsObject {
|
||||
}
|
||||
|
||||
extern {
|
||||
fn __wasm_bindgen_object_clone_ref(idx: u32) -> u32;
|
||||
fn __wasm_bindgen_object_drop_ref(idx: u32);
|
||||
fn __wbindgen_object_clone_ref(idx: u32) -> u32;
|
||||
fn __wbindgen_object_drop_ref(idx: u32);
|
||||
}
|
||||
|
||||
impl Clone for JsObject {
|
||||
fn clone(&self) -> JsObject {
|
||||
unsafe {
|
||||
let idx = __wasm_bindgen_object_clone_ref(self.idx);
|
||||
let idx = __wbindgen_object_clone_ref(self.idx);
|
||||
JsObject { idx }
|
||||
}
|
||||
}
|
||||
@ -49,7 +49,7 @@ impl Clone for JsObject {
|
||||
impl Drop for JsObject {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
__wasm_bindgen_object_drop_ref(self.idx);
|
||||
__wbindgen_object_drop_ref(self.idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user