Index: src/variables.cc |
diff --git a/src/variables.cc b/src/variables.cc |
index 18a45abd73890b3fae56caee89618e0f1224ce21..b8fddd306df59ff86b15d00a7e7df009e4662261 100644 |
--- a/src/variables.cc |
+++ b/src/variables.cc |
@@ -58,7 +58,9 @@ 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_) || IsStaticGlobalObjectProperty(); |
+ return (IsDynamicVariableMode(mode_) || |
+ (IsDeclaredVariableMode(mode_) && !IsLexicalVariableMode(mode_))) && |
+ scope_ != NULL && scope_->is_script_scope() && !is_this(); |
} |