From f5d080dcf7aec19850d021c22ee111f7b827279d Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Fri, 19 Jul 2019 21:30:17 -0700 Subject: [PATCH] Don't leak data from constants outside of the parserEventually we will get rid of the object in constants, so we don't want others to expect this data to be here. --- experiments/modern/src/maki-interpreter/parser.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/experiments/modern/src/maki-interpreter/parser.js b/experiments/modern/src/maki-interpreter/parser.js index cc425a96..ccbdb31b 100644 --- a/experiments/modern/src/maki-interpreter/parser.js +++ b/experiments/modern/src/maki-interpreter/parser.js @@ -220,18 +220,13 @@ function parseComand({ start, makiFile, length, pos }) { pos, opcode, arg: null, - command: COMMANDS[opcode], }; - if (command.command == null) { - throw new Error(`Unknown opcode "${opcode}"`); - } - - if (command.command.arg == null) { + const argType = COMMANDS[opcode].arg; + if (argType == null) { return command; } - const argType = command.command.arg; let arg = null; switch (argType) { case "var": {