diff --git a/src/core/parser.js b/src/core/parser.js index b5a4b791a..a4dc3e4f0 100644 --- a/src/core/parser.js +++ b/src/core/parser.js @@ -755,19 +755,19 @@ var Lexer = (function LexerClosure() { // command var str = String.fromCharCode(ch); var knownCommands = this.knownCommands; - var knownCommandFound = knownCommands && (str in knownCommands); + var knownCommandFound = knownCommands && knownCommands[str] !== undefined; while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { // stop if known command is found and next character does not make // the str a command var possibleCommand = str + String.fromCharCode(ch); - if (knownCommandFound && !(possibleCommand in knownCommands)) { + if (knownCommandFound && knownCommands[possibleCommand] === undefined) { break; } if (str.length === 128) { error('Command token too long: ' + str.length); } str = possibleCommand; - knownCommandFound = knownCommands && (str in knownCommands); + knownCommandFound = knownCommands && knownCommands[str] !== undefined; } if (str === 'true') { return true;