Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Unified Diff: src/variables.cc

Issue 1228373011: Fix broken Variable::IsGlobalObjectProperty() after https://codereview.chromium.org/1218783005 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698