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 | d2aa017a88a4b918ded2159cd202ce6c7c7218d0 (patch) | |
tree | 4e80f42f83afdc2c670199d9f010749a4efda4c4 /js/src/frontend | |
parent | 57a8b65fc0c4bd12149855d972aea05828e4d6e7 (diff) | |
download | UXP-d2aa017a88a4b918ded2159cd202ce6c7c7218d0.tar UXP-d2aa017a88a4b918ded2159cd202ce6c7c7218d0.tar.gz UXP-d2aa017a88a4b918ded2159cd202ce6c7c7218d0.tar.lz UXP-d2aa017a88a4b918ded2159cd202ce6c7c7218d0.tar.xz UXP-d2aa017a88a4b918ded2159cd202ce6c7c7218d0.zip |
1339963 - Part 2: Use MUST_MATCH_TOKEN for contextual keyword where it can be used.
Diffstat (limited to 'js/src/frontend')
-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 16d4a377a..f382ec5e9 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); } |