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; |