If I create a struct in rust and export the struct via #[wasm_bindgen]
attribute, and if I then inherit this struct from javascript space, my Javascript derived class will only be recognized as the parent class. For example, if I override any methods of the parent class, only the parent class methods are called. Also, obj instanceof DerivedClass == false
and obj instance ParentClass == true
, where i would expect both instanceof
conditions to be true.
Create a struct A
in rust and export the struct via #[wasm_bindgen]
In javasript, create a class B
that inherits the Rust struct A
Create an instance of your derived javascript class. let obj = new B()
test expect(obj instanceof B).toBe(true)
Step 4 should pass
Actual BehaviorStep 4 will fail (obj is not an instance of B)
Additional ContextWhy this matters is because when I override any methods of the Base class, the override methods are not being called, but instead only the base methods are being called.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4