wasm-bindgen/crates/webidl-tests/enums.js
Alex Crichton 7e16690f10
Migrate webidl tests to wasm_bindgen_test (#590)
This commit moves the `webidl/tests` folder to a new `crates/webidl-tests` crate
(to have a test-only build script) and ports them to the `#[wasm_bindgen_test]`
attribute, which should hopefully make testing much speedier for execution!
2018-07-30 11:06:29 -07:00

22 lines
293 B
JavaScript

global.Shape = class Shape {
constructor(kind) {
this.kind = kind;
}
static triangle() {
return new Shape('triangle');
}
isSquare() {
return this.kind === 'square';
}
isCircle() {
return this.kind === 'circle';
}
getShape() {
return this.kind;
}
};