| Index: src/scopes.h
|
| diff --git a/src/scopes.h b/src/scopes.h
|
| index d08e2948242d1e52e61c33853d5e8281a2063b27..3a8a59384cace8ded44eabcac21de789a59c1592 100644
|
| --- a/src/scopes.h
|
| +++ b/src/scopes.h
|
| @@ -192,8 +192,8 @@ class Scope: public ZoneObject {
|
| void RecordEvalCall() { if (!is_global_scope()) scope_calls_eval_ = true; }
|
|
|
| // Set the strict mode flag (unless disabled by a global flag).
|
| - void SetStrictModeFlag(StrictModeFlag strict_mode_flag) {
|
| - strict_mode_flag_ = FLAG_strict_mode ? strict_mode_flag : kNonStrictMode;
|
| + void SetLanguageMode(LanguageMode language_mode) {
|
| + language_mode_ = language_mode;
|
| }
|
|
|
| // Position in the source where this scope begins and ends.
|
| @@ -240,15 +240,20 @@ class Scope: public ZoneObject {
|
| bool is_declaration_scope() const {
|
| return is_eval_scope() || is_function_scope() || is_global_scope();
|
| }
|
| - bool is_strict_mode() const { return strict_mode_flag() == kStrictMode; }
|
| - bool is_strict_mode_eval_scope() const {
|
| - return is_eval_scope() && is_strict_mode();
|
| + bool is_classic_mode() const {
|
| + return language_mode() == CLASSIC_MODE;
|
| + }
|
| + bool is_extended_mode() const {
|
| + return language_mode() == EXTENDED_MODE;
|
| + }
|
| + bool is_strict_or_extended_eval_scope() const {
|
| + return is_eval_scope() && !is_classic_mode();
|
| }
|
|
|
| // Information about which scopes calls eval.
|
| bool calls_eval() const { return scope_calls_eval_; }
|
| bool calls_non_strict_eval() {
|
| - return scope_calls_eval_ && !is_strict_mode();
|
| + return scope_calls_eval_ && is_classic_mode();
|
| }
|
| bool outer_scope_calls_non_strict_eval() const {
|
| return outer_scope_calls_non_strict_eval_;
|
| @@ -268,8 +273,8 @@ class Scope: public ZoneObject {
|
| // The type of this scope.
|
| ScopeType type() const { return type_; }
|
|
|
| - // The strict mode of this scope.
|
| - StrictModeFlag strict_mode_flag() const { return strict_mode_flag_; }
|
| + // The language mode of this scope.
|
| + LanguageMode language_mode() const { return language_mode_; }
|
|
|
| // The variable corresponding the 'this' value.
|
| Variable* receiver() { return receiver_; }
|
| @@ -425,7 +430,7 @@ class Scope: public ZoneObject {
|
| // the 'eval' call site this scope is the declaration scope.
|
| bool scope_calls_eval_;
|
| // This scope is a strict mode scope.
|
| - StrictModeFlag strict_mode_flag_;
|
| + LanguageMode language_mode_;
|
| // Source positions.
|
| int start_position_;
|
| int end_position_;
|
|
|