Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index b146809a24e19a745a5d3810b97ad4bcff8412d9..9739e556e4c4411a3148853ec9e7aad7510d77b0 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -1836,13 +1836,9 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
+ ASSERT(expr->target()->IsValidLeftHandSide()); |
+ |
Comment cmnt(masm_, "[ Assignment"); |
- // Invalid left-hand sides are rewritten to have a 'throw ReferenceError' |
- // on the left-hand side. |
- if (!expr->target()->IsValidLeftHandSide()) { |
- VisitForEffect(expr->target()); |
- return; |
- } |
// Left-hand side can only be a property, a global or a (parameter or local) |
// slot. |
@@ -2339,12 +2335,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, |
void FullCodeGenerator::EmitAssignment(Expression* expr) { |
- // Invalid left-hand sides are rewritten by the parser to have a 'throw |
- // ReferenceError' on the left-hand side. |
- if (!expr->IsValidLeftHandSide()) { |
- VisitForEffect(expr); |
- return; |
- } |
+ ASSERT(expr->IsValidLeftHandSide()); |
// Left-hand side can only be a property, a global or a (parameter or local) |
// slot. |
@@ -4270,16 +4261,11 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
+ ASSERT(expr->expression()->IsValidLeftHandSide()); |
+ |
Comment cmnt(masm_, "[ CountOperation"); |
SetSourcePosition(expr->position()); |
- // Invalid left-hand-sides are rewritten to have a 'throw |
- // ReferenceError' as the left-hand side. |
- if (!expr->expression()->IsValidLeftHandSide()) { |
- VisitForEffect(expr->expression()); |
- return; |
- } |
- |
// Expression can only be a property, a global or a (parameter or local) |
// slot. |
enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; |