diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-06-09 22:32:35 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-07-18 22:38:38 -0400 |
commit | 0f03be9a8348cbc5861e8da2e0dfb1ae70ebdd4d (patch) | |
tree | 4e80f42f83afdc2c670199d9f010749a4efda4c4 | |
parent | 0c8be40701c58d68ba2b072c0a51b2ddb660bfa4 (diff) | |
download | uxp-0f03be9a8348cbc5861e8da2e0dfb1ae70ebdd4d.tar.gz |
1339963 - Part 2: Use MUST_MATCH_TOKEN for contextual keyword where it can be used.
-rw-r--r-- | js/src/frontend/Parser.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 16d4a377a0..f382ec5e9e 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -4915,13 +4915,7 @@ Parser<FullParseHandler>::importDeclaration() return null(); } - if (!tokenStream.getToken(&tt)) - return null(); - - if (tt != TOK_FROM) { - error(JSMSG_FROM_AFTER_IMPORT_CLAUSE); - return null(); - } + MUST_MATCH_TOKEN(TOK_FROM, JSMSG_FROM_AFTER_IMPORT_CLAUSE); MUST_MATCH_TOKEN(TOK_STRING, JSMSG_MODULE_SPEC_AFTER_FROM); } @@ -5125,13 +5119,7 @@ Parser<ParseHandler>::exportBatch(uint32_t begin) handler.addList(kid, exportSpec); - TokenKind tt; - if (!tokenStream.getToken(&tt)) - return null(); - if (tt != TOK_FROM) { - error(JSMSG_FROM_AFTER_EXPORT_STAR); - return null(); - } + MUST_MATCH_TOKEN(TOK_FROM, JSMSG_FROM_AFTER_EXPORT_STAR); return exportFrom(begin, kid); } |