Index: src/variables.cc |
diff --git a/src/variables.cc b/src/variables.cc |
index 49846fee31b8001c2084d9ae1cdc0b9b62aab879..d1785e886a993ddc492dcba4b8797773ca3a0cae 100644 |
--- a/src/variables.cc |
+++ b/src/variables.cc |
@@ -58,8 +58,14 @@ Variable::Variable(Scope* scope, const AstRawString* name, VariableMode mode, |
bool Variable::IsGlobalObjectProperty() const { |
// Temporaries are never global, they must always be allocated in the |
// activation frame. |
- return (IsDynamicVariableMode(mode_) || |
- (IsDeclaredVariableMode(mode_) && !IsLexicalVariableMode(mode_))) && |
+ return IsDynamicVariableMode(mode_) || IsStaticGlobalObjectProperty(); |
+} |
+ |
+ |
+bool Variable::IsStaticGlobalObjectProperty() const { |
+ // Temporaries are never global, they must always be allocated in the |
+ // activation frame. |
+ return (IsDeclaredVariableMode(mode_) && !IsLexicalVariableMode(mode_)) && |
scope_ != NULL && scope_->is_script_scope() && !is_this(); |
} |