mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
This commit implements the `extends` attribute for `#[wasm_bindgen]` to statically draw the inheritance hierarchy in the generated bindings, generating appropriate `AsRef`, `AsMut`, and `From` implementations.
29 lines
393 B
JavaScript
29 lines
393 B
JavaScript
class JsCast1 {
|
|
constructor() {
|
|
this.val = 1;
|
|
}
|
|
myval() { return this.val; }
|
|
}
|
|
|
|
class JsCast2 {
|
|
}
|
|
|
|
class JsCast3 extends JsCast1 {
|
|
constructor() {
|
|
super();
|
|
this.val = 3;
|
|
}
|
|
}
|
|
|
|
class JsCast4 extends JsCast3 {
|
|
constructor() {
|
|
super();
|
|
this.val = 4;
|
|
}
|
|
}
|
|
|
|
exports.JsCast1 = JsCast1;
|
|
exports.JsCast2 = JsCast2;
|
|
exports.JsCast3 = JsCast3;
|
|
exports.JsCast4 = JsCast4;
|