| Index: src/scopes.cc
|
| diff --git a/src/scopes.cc b/src/scopes.cc
|
| index f9cebcddaafff5532c4aac23ab7af06dd9a7c220..e8c1f272736a90971134bf50bb006722f71a8605 100644
|
| --- a/src/scopes.cc
|
| +++ b/src/scopes.cc
|
| @@ -148,6 +148,9 @@ Scope::Scope(Scope* inner_scope,
|
| SetDefaults(type, NULL, scope_info);
|
| if (!scope_info.is_null()) {
|
| num_heap_slots_ = scope_info_->ContextLength();
|
| + if (*scope_info != ScopeInfo::Empty()) {
|
| + language_mode_ = scope_info->language_mode();
|
| + }
|
| }
|
| AddInnerScope(inner_scope);
|
| }
|
| @@ -190,8 +193,8 @@ void Scope::SetDefaults(ScopeType type,
|
| scope_contains_with_ = false;
|
| scope_calls_eval_ = false;
|
| // Inherit the strict mode from the parent scope.
|
| - strict_mode_flag_ = (outer_scope != NULL)
|
| - ? outer_scope->strict_mode_flag_ : kNonStrictMode;
|
| + language_mode_ = (outer_scope != NULL)
|
| + ? outer_scope->language_mode_ : CLASSIC_MODE;
|
| outer_scope_calls_non_strict_eval_ = false;
|
| inner_scope_calls_eval_ = false;
|
| force_eager_compilation_ = false;
|
| @@ -763,7 +766,16 @@ void Scope::Print(int n) {
|
| if (HasTrivialOuterContext()) {
|
| Indent(n1, "// scope has trivial outer context\n");
|
| }
|
| - if (is_strict_mode()) Indent(n1, "// strict mode scope\n");
|
| + switch (language_mode()) {
|
| + case CLASSIC_MODE:
|
| + break;
|
| + case STRICT_MODE:
|
| + Indent(n1, "// strict mode scope\n");
|
| + break;
|
| + case EXTENDED_MODE:
|
| + Indent(n1, "// extended mode scope\n");
|
| + break;
|
| + }
|
| if (scope_inside_with_) Indent(n1, "// scope inside 'with'\n");
|
| if (scope_contains_with_) Indent(n1, "// scope contains 'with'\n");
|
| if (scope_calls_eval_) Indent(n1, "// scope calls 'eval'\n");
|
| @@ -973,7 +985,7 @@ bool Scope::PropagateScopeInfo(bool outer_scope_calls_non_strict_eval ) {
|
| }
|
|
|
| bool calls_non_strict_eval =
|
| - (scope_calls_eval_ && !is_strict_mode()) ||
|
| + this->calls_non_strict_eval() ||
|
| outer_scope_calls_non_strict_eval_;
|
| for (int i = 0; i < inner_scopes_.length(); i++) {
|
| Scope* inner_scope = inner_scopes_[i];
|
| @@ -1070,7 +1082,7 @@ void Scope::AllocateParameterLocals() {
|
| // In strict mode 'arguments' does not alias formal parameters.
|
| // Therefore in strict mode we allocate parameters as if 'arguments'
|
| // were not used.
|
| - uses_nonstrict_arguments = !is_strict_mode();
|
| + uses_nonstrict_arguments = is_classic_mode();
|
| }
|
|
|
| // The same parameter may occur multiple times in the parameters_ list.
|
|
|