diff options
Diffstat (limited to 'vendor/wasm-bindgen/src/convert/impls.rs')
-rw-r--r-- | vendor/wasm-bindgen/src/convert/impls.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/vendor/wasm-bindgen/src/convert/impls.rs b/vendor/wasm-bindgen/src/convert/impls.rs index 79ccd67af..e8636fe9e 100644 --- a/vendor/wasm-bindgen/src/convert/impls.rs +++ b/vendor/wasm-bindgen/src/convert/impls.rs @@ -2,7 +2,7 @@ use core::char; use core::mem::{self, ManuallyDrop}; use crate::convert::traits::WasmAbi; -use crate::convert::{FromWasmAbi, IntoWasmAbi, RefFromWasmAbi}; +use crate::convert::{FromWasmAbi, IntoWasmAbi, LongRefFromWasmAbi, RefFromWasmAbi}; use crate::convert::{OptionFromWasmAbi, OptionIntoWasmAbi, ReturnWasmAbi}; use crate::{Clamped, JsError, JsValue}; @@ -248,6 +248,16 @@ impl RefFromWasmAbi for JsValue { } } +impl LongRefFromWasmAbi for JsValue { + type Abi = u32; + type Anchor = JsValue; + + #[inline] + unsafe fn long_ref_from_abi(js: u32) -> Self::Anchor { + Self::from_abi(js) + } +} + impl<T: OptionIntoWasmAbi> IntoWasmAbi for Option<T> { type Abi = T::Abi; |