Index: src/parsing/parser-base.h |
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
index f097456850a82d010851781558c3da219b957388..6be19b397c2d603ffce011f6811c924b0c676c27 100644 |
--- a/src/parsing/parser-base.h |
+++ b/src/parsing/parser-base.h |
@@ -2241,13 +2241,15 @@ ParserBase<Traits>::ParseBinaryExpression(int prec, bool accept_IN, |
ReportMessageAt(op_location, MessageTemplate::kStrongEqual); |
*ok = false; |
return this->EmptyExpression(); |
+ } else if (FLAG_harmony_instanceof && cmp == Token::INSTANCEOF) { |
+ x = Traits::RewriteInstanceof(x, y, pos); |
+ } else { |
+ x = factory()->NewCompareOperation(cmp, x, y, pos); |
+ if (cmp != op) { |
+ // The comparison was negated - add a NOT. |
+ x = factory()->NewUnaryOperation(Token::NOT, x, pos); |
+ } |
} |
- x = factory()->NewCompareOperation(cmp, x, y, pos); |
- if (cmp != op) { |
- // The comparison was negated - add a NOT. |
- x = factory()->NewUnaryOperation(Token::NOT, x, pos); |
- } |
- |
} else { |
// We have a "normal" binary operation. |
x = factory()->NewBinaryOperation(op, x, y, pos); |