mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-29 13:06:06 +03:00
7e16690f10
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!
22 lines
293 B
JavaScript
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;
|
|
}
|
|
};
|