Open
Description
Right now you can't write a function like:
#[wasm_bindgen]
#[no_mangle]
pub extern fn foo(a: &JsValue) -> &JsValue {
a
}
This is because JsValue
goes through all the same machinery as Foo
, but I think we want to add a specific trait for "can be returned as a reference" or maybe even just AsRef<JsValue>
as I think that's the only way this can work?
Enabling this would help avoid an unnecessary Clone
otherwise to extract data from wasm back into JS.