Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: src/parsing/parser.cc

Issue 1906923002: [modules] Infer strict mode from within scope object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index e8c86427953994df18bb1608c51afd44537c7170..96b97266fe99ad8b1a6c03385734da2fbfaadd96 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -917,15 +917,15 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
FunctionState function_state(&function_state_, &scope_, scope,
kNormalFunction, &function_factory);
- // Don't count the mode in the use counters--give the program a chance
- // to enable script/module-wide strict mode below.
- scope_->SetLanguageMode(info->language_mode());
ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone());
bool ok = true;
int beg_pos = scanner()->location().beg_pos;
if (info->is_module()) {
ParseModuleItemList(body, &ok);
} else {
+ // Don't count the mode in the use counters--give the program a chance
+ // to enable script-wide strict mode below.
+ scope_->SetLanguageMode(info->language_mode());
ParseStatementList(body, Token::EOS, &ok);
}
@@ -1295,7 +1295,6 @@ void* Parser::ParseModuleItemList(ZoneList<Statement*>* body, bool* ok) {
// ModuleItem*
DCHECK(scope_->is_module_scope());
- RaiseLanguageMode(STRICT);
while (peek() != Token::EOS) {
Statement* stat = ParseModuleItem(CHECK_OK);
« no previous file with comments | « src/ast/scopes.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698