case.js 305 B

123456789101112131415161718
  1. import { Command } from './command';
  2. export class Case extends Command {
  3. constructor (expression) {
  4. super();
  5. this.expression = expression;
  6. this.commands = [];
  7. }
  8. setCommands (commands) {
  9. this.commands = commands;
  10. }
  11. get isDefault () {
  12. return this.expression === null;
  13. }
  14. }