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

Unified Diff: src/ast/scopes.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.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 5d4b80987607b531c423a35c04cdec582a870371..903a683020fc6ca2ca40c295d2962b1470aabfe7 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -175,7 +175,10 @@ void Scope::SetDefaults(ScopeType scope_type, Scope* outer_scope,
asm_module_ = false;
asm_function_ = outer_scope != NULL && outer_scope->asm_module_;
// Inherit the language mode from the parent scope.
- language_mode_ = outer_scope != NULL ? outer_scope->language_mode_ : SLOPPY;
+ language_mode_ =
+ is_module_scope()
+ ? STRICT
+ : (outer_scope != NULL ? outer_scope->language_mode_ : SLOPPY);
outer_scope_calls_sloppy_eval_ = false;
inner_scope_calls_eval_ = false;
scope_nonlinear_ = false;
« no previous file with comments | « src/ast/scopes.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698