wasm-bindgen/crates/webidl-tests/enums.js

22 lines
293 B
JavaScript
Raw Normal View History

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;
}
};