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.

This commit is contained in:
Jordan Eldredge 2019-07-19 21:30:17 -07:00
parent 19c24d18f9
commit f5d080dcf7

View file

@ -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": {