| Index: src/scopes.h
|
| diff --git a/src/scopes.h b/src/scopes.h
|
| index 72f1e31878efb744ac8d1210f531d1d16b7a0026..40898f8c6b36bad9e83f15ca66303848d037db95 100644
|
| --- a/src/scopes.h
|
| +++ b/src/scopes.h
|
| @@ -201,9 +201,9 @@ class Scope: public ZoneObject {
|
| // Inform the scope that the corresponding code contains an eval call.
|
| void RecordEvalCall() { if (!is_global_scope()) scope_calls_eval_ = true; }
|
|
|
| - // Enable strict mode for the scope (unless disabled by a global flag).
|
| - void EnableStrictMode() {
|
| - strict_mode_ = FLAG_strict_mode;
|
| + // 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;
|
| }
|
|
|
| // ---------------------------------------------------------------------------
|
| @@ -219,7 +219,7 @@ 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_; }
|
| + bool is_strict_mode() const { return strict_mode_flag() == kStrictMode; }
|
| bool is_strict_mode_eval_scope() const {
|
| return is_eval_scope() && is_strict_mode();
|
| }
|
| @@ -244,6 +244,8 @@ class Scope: public ZoneObject {
|
| // ---------------------------------------------------------------------------
|
| // Accessors.
|
|
|
| + StrictModeFlag strict_mode_flag() const { return strict_mode_flag_; }
|
| +
|
| // The variable corresponding the 'this' value.
|
| Variable* receiver() { return receiver_; }
|
|
|
| @@ -386,7 +388,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.
|
| - bool strict_mode_;
|
| + StrictModeFlag strict_mode_flag_;
|
|
|
| // Computed via PropagateScopeInfo.
|
| bool outer_scope_calls_non_strict_eval_;
|
|
|