You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm on wasm-bindgen@0.2.31 and getting "__wrap is not a function" when calling a closure which returns a struct that is not used anywhere else.
Here's the smallest example of the bug, I could make:
typeClosureType = FnMut() -> BadStruct;#[wasm_bindgen]pubstructClosureHandle(Closure<ClosureType>);#[wasm_bindgen]pubstructBadStruct{}#[wasm_bindgen]pubfnclosure_returner() -> Result<Object,JsValue>{let o = Object::new();let some_fn = Closure::wrap(Box::new(move || BadStruct{})asBox<ClosureType>);Reflect::set(&o,&JsValue::from("someKey"),&some_fn.as_ref().unchecked_ref(),).map_err(|_| "Unable to set property")?;Reflect::set(&o,&JsValue::from("handle"),&JsValue::from(ClosureHandle(some_fn)),).map_err(|_| "Unable to set closure handle")?;Ok(o)}
I'm on wasm-bindgen@0.2.31 and getting "__wrap is not a function" when calling a closure which returns a struct that is not used anywhere else.
Here's the smallest example of the bug, I could make:
Typescript:
Currently this works as a workaround:
Edit: Related to #949, but not exactly the same.
The text was updated successfully, but these errors were encountered: