Update to recent WasmBoundary abi changes

This commit is contained in:
Alex Crichton 2018-04-02 09:58:27 -07:00
parent 188d368583
commit 03433a0ef6
2 changed files with 13 additions and 6 deletions

View File

@ -156,7 +156,10 @@ impl ToTokens for ast::Struct {
impl ::std::convert::From<#name> for ::wasm_bindgen::JsValue {
fn from(value: #name) -> Self {
let ptr = ::wasm_bindgen::convert::WasmBoundary::into_js(value);
let ptr = ::wasm_bindgen::convert::WasmBoundary::into_abi(
value,
unsafe { &mut ::wasm_bindgen::convert::GlobalStack::new() },
);
#[wasm_import_module = "__wbindgen_placeholder__"]
extern {
@ -164,7 +167,11 @@ impl ToTokens for ast::Struct {
}
unsafe {
::wasm_bindgen::JsValue::__from_idx(#new_fn(ptr))
<::wasm_bindgen::JsValue as ::wasm_bindgen::convert::WasmBoundary>
::from_abi(
#new_fn(ptr),
unsafe { &mut ::wasm_bindgen::convert::GlobalStack::new() },
)
}
}
}

View File

@ -94,10 +94,10 @@ impl JsValue {
}
}
#[doc(hidden)]
pub unsafe fn __from_idx(idx: u32) -> JsValue {
JsValue { idx }
}
// #[doc(hidden)]
// pub unsafe fn __from_idx(idx: u32) -> JsValue {
// JsValue { idx }
// }
//
// #[doc(hidden)]
// pub fn __get_idx(&self) -> u32 {