mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-28 14:27:36 +03: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…
Reference in New Issue
Block a user