mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-11 14:46:04 +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");
|
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_add_heap_object();
|
||||||
self.expose_get_object();
|
self.expose_get_object();
|
||||||
imports.push_str("
|
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 this object is on the stack promote it to the heap.
|
||||||
if ((idx & 1) === 1) {
|
if ((idx & 1) === 1) {
|
||||||
return addHeapObject(getObject(idx));
|
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();
|
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) {
|
if self.wasm_import_needed("__wbindgen_throw", m) {
|
||||||
|
@ -33,14 +33,14 @@ impl JsObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
fn __wasm_bindgen_object_clone_ref(idx: u32) -> u32;
|
fn __wbindgen_object_clone_ref(idx: u32) -> u32;
|
||||||
fn __wasm_bindgen_object_drop_ref(idx: u32);
|
fn __wbindgen_object_drop_ref(idx: u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Clone for JsObject {
|
impl Clone for JsObject {
|
||||||
fn clone(&self) -> JsObject {
|
fn clone(&self) -> JsObject {
|
||||||
unsafe {
|
unsafe {
|
||||||
let idx = __wasm_bindgen_object_clone_ref(self.idx);
|
let idx = __wbindgen_object_clone_ref(self.idx);
|
||||||
JsObject { idx }
|
JsObject { idx }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ impl Clone for JsObject {
|
|||||||
impl Drop for JsObject {
|
impl Drop for JsObject {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
__wasm_bindgen_object_drop_ref(self.idx);
|
__wbindgen_object_drop_ref(self.idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user