Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index 174679ab83c138e3190e6bda3a158baabb89a9e3..205560f586106c8bc1e8c54576b14a64fb9558fa 100644 |
--- a/src/ast.h |
+++ b/src/ast.h |
@@ -204,6 +204,8 @@ class Expression: public AstNode { |
virtual bool IsValidLeftHandSide() { return false; } |
+ virtual Variable* AssignedVar() { return NULL; } |
+ |
// Symbols that cannot be parsed as array indices are considered property |
// names. We do not treat symbols that can be array indexes as property |
// names because [] for string objects is handled only by keyed ICs. |
@@ -1278,6 +1280,10 @@ class CountOperation: public Expression { |
virtual CountOperation* AsCountOperation() { return this; } |
+ virtual Variable* AssignedVar() { |
+ return expression()->AsVariableProxy()->AsVariable(); |
+ } |
+ |
bool is_prefix() const { return is_prefix_; } |
bool is_postfix() const { return !is_prefix_; } |
Token::Value op() const { return op_; } |
@@ -1358,6 +1364,10 @@ class Assignment: public Expression { |
Assignment* AsSimpleAssignment() { return !is_compound() ? this : NULL; } |
+ virtual Variable* AssignedVar() { |
+ return target()->AsVariableProxy()->AsVariable(); |
+ } |
+ |
Token::Value binary_op() const; |
Token::Value op() const { return op_; } |