mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Add From/Into JsValue for imported types
This commit is contained in:
parent
48b34604cb
commit
fc81d8f6d3
@ -369,6 +369,18 @@ impl ToTokens for ast::ImportType {
|
||||
self.obj.to_js_ref()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<::wasm_bindgen::JsValue> for #name {
|
||||
fn from(obj: ::wasm_bindgen::JsValue) -> #name {
|
||||
#name { obj }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<#name> for ::wasm_bindgen::JsValue {
|
||||
fn from(obj: #name) -> ::wasm_bindgen::JsValue {
|
||||
obj.obj
|
||||
}
|
||||
}
|
||||
}).to_tokens(tokens);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user