mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-27 12:06:14 +03:00
37db88ebfa
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;
|