Index: src/scopes.h |
diff --git a/src/scopes.h b/src/scopes.h |
index d08e2948242d1e52e61c33853d5e8281a2063b27..b412773d5d9711e613eb12fc5464a323bde90133 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_ = FLAG_strict_mode ? language_mode : CLASSIC_MODE; |
rossberg
2011/11/08 15:02:46
Does such a flag still make sense given the new la
Steven
2011/11/08 16:13:49
Not really. Removing it.
On 2011/11/08 15:02:46, r
|
} |
// Position in the source where this scope begins and ends. |
@@ -240,15 +240,23 @@ 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_mode() const { |
rossberg
2011/11/08 15:02:46
And one more.
Steven
2011/11/08 16:13:49
Done.
|
+ return language_mode() != CLASSIC_MODE; |
+ } |
+ bool is_strict_or_extended_eval_scope() const { |
+ return is_eval_scope() && is_strict_or_extended_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 +276,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 +433,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_; |