Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index 9b86d0b51292f6291b734962af0f8912e8218f4d..fbc89d54c3ccc45f53484330bedf93e6564bab81 100644 |
--- a/src/ast.h |
+++ b/src/ast.h |
@@ -1599,7 +1599,7 @@ class VariableProxy FINAL : public Expression { |
DECLARE_NODE_TYPE(VariableProxy) |
bool IsValidReferenceExpression() const OVERRIDE { |
- return !is_resolved() || var()->IsValidReference(); |
+ return !is_this() && !is_new_target(); |
} |
bool IsArguments() const { return is_resolved() && var()->is_arguments(); } |
@@ -1621,6 +1621,8 @@ class VariableProxy FINAL : public Expression { |
bool is_this() const { return IsThisField::decode(bit_field_); } |
+ bool is_new_target() const { return IsNewTargetField::decode(bit_field_); } |
+ |
bool is_assigned() const { return IsAssignedField::decode(bit_field_); } |
void set_is_assigned() { |
bit_field_ = IsAssignedField::update(bit_field_, true); |
@@ -1655,12 +1657,13 @@ class VariableProxy FINAL : public Expression { |
protected: |
VariableProxy(Zone* zone, Variable* var, int position); |
- VariableProxy(Zone* zone, const AstRawString* name, bool is_this, |
- int position); |
+ VariableProxy(Zone* zone, const AstRawString* name, |
+ Variable::Kind variable_kind, int position); |
class IsThisField : public BitField8<bool, 0, 1> {}; |
class IsAssignedField : public BitField8<bool, 1, 1> {}; |
class IsResolvedField : public BitField8<bool, 2, 1> {}; |
+ class IsNewTargetField : public BitField8<bool, 3, 1> {}; |
// Start with 16-bit (or smaller) field, which should get packed together |
// with Expression's trailing 16-bit field. |
@@ -3358,9 +3361,9 @@ class AstNodeFactory FINAL BASE_EMBEDDED { |
} |
VariableProxy* NewVariableProxy(const AstRawString* name, |
- bool is_this, |
+ Variable::Kind variable_kind, |
int position = RelocInfo::kNoPosition) { |
- return new (zone_) VariableProxy(zone_, name, is_this, position); |
+ return new (zone_) VariableProxy(zone_, name, variable_kind, position); |
} |
Property* NewProperty(Expression* obj, Expression* key, int pos) { |