From 0f03be9a8348cbc5861e8da2e0dfb1ae70ebdd4d Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 9 Jun 2019 22:32:35 -0400 Subject: 1339963 - Part 2: Use MUST_MATCH_TOKEN for contextual keyword where it can be used. --- js/src/frontend/Parser.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'js/src/frontend/Parser.cpp') 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::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::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); } -- cgit v1.2.3