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

Unified Diff: src/ast.h

Issue 3432022: Clean up some messiness in Scopes. (Closed)
Patch Set: Created 10 years, 3 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 | « src/arm/full-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 181d798f280095dfc0543a197c8b4c655fb837fc..1e3d02594c5912d2938c786fe71872bf0e5be7d1 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -948,6 +948,8 @@ class CatchExtensionObject: public Expression {
class VariableProxy: public Expression {
public:
+ explicit VariableProxy(Variable* var);
+
virtual void Accept(AstVisitor* v);
// Type testing & conversion
@@ -960,7 +962,10 @@ class VariableProxy: public Expression {
}
Variable* AsVariable() {
- return this == NULL || var_ == NULL ? NULL : var_->AsVariable();
+ if (this == NULL || var_ == NULL) return NULL;
+ Expression* rewrite = var_->rewrite();
+ if (rewrite == NULL || rewrite->AsSlot() != NULL) return var_;
+ return NULL;
}
virtual bool IsValidLeftHandSide() {
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698