Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 22f74807fbadfd382d89c298158638c4bbedcdbd..6bfb7d2205dc7d2eba7afa80966ff7aabcce2354 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -929,8 +929,10 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) { |
bool ok = true; |
int beg_pos = scanner()->location().beg_pos; |
if (info->is_module()) { |
+ parsing_module_ = true; |
ParseModuleItemList(body, &ok); |
} else { |
+ parsing_module_ = false; |
ParseStatementList(body, Token::EOS, &ok); |
} |
@@ -1364,7 +1366,7 @@ void* Parser::ParseExportClause(ZoneList<const AstRawString*>* export_names, |
// Keep track of the first reserved word encountered in case our |
// caller needs to report an error. |
if (!reserved_loc->IsValid() && |
- !Token::IsIdentifier(name_tok, STRICT, false)) { |
+ !Token::IsIdentifier(name_tok, STRICT, false, true)) { |
*reserved_loc = scanner()->location(); |
} |
const AstRawString* local_name = ParseIdentifierName(CHECK_OK); |
@@ -1415,7 +1417,7 @@ ZoneList<ImportDeclaration*>* Parser::ParseNamedImports(int pos, bool* ok) { |
if (CheckContextualKeyword(CStrVector("as"))) { |
local_name = ParseIdentifierName(CHECK_OK); |
} |
- if (!Token::IsIdentifier(scanner()->current_token(), STRICT, false)) { |
+ if (!Token::IsIdentifier(scanner()->current_token(), STRICT, false, true)) { |
*ok = false; |
ReportMessage(MessageTemplate::kUnexpectedReserved); |
return NULL; |
@@ -4681,7 +4683,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser( |
} |
PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction( |
language_mode(), function_state_->kind(), scope_->has_simple_parameters(), |
- logger, bookmark); |
+ parsing_module_, logger, bookmark); |
if (pre_parse_timer_ != NULL) { |
pre_parse_timer_->Stop(); |
} |