Fix broken Variable::IsGlobalObjectProperty() after https://codereview.chromium.org/1218783005

Review URL: https://codereview.chromium.org/1228373011

Cr-Commit-Position: refs/heads/master@{#29682}
This commit is contained in:
ishell 2015-07-15 07:42:24 -07:00 committed by Commit bot
parent 1d9d895754
commit 3bf9935288

View File

@ -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();
}