wasm-bindgen/tests/wasm/jscast.js
Alex Crichton 37db88ebfa Implement #[wasm_bindgen(extends = ...)]
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.
2018-08-07 13:04:11 -07:00

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;