Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 073800d8167d4583c3091880555cb5b474ed11c6..e049c84539795dea890b5571bc7bc2db153716a3 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -5431,7 +5431,7 @@ Statement* Parser::FinalizeForOfStatement(ForOfStatement* loop, |
// %ReThrow(e); |
// } |
// } finally { |
- // if (!(completion === kNormalCompletion || IS_UNDEFINED(#iterator))) { |
+ // if (!(completion === kNormalCompletion)) { |
neis
2016/11/28 14:52:51
See below.
|
// #BuildIteratorCloseForCompletion(#iterator, completion) |
// } |
// } |
@@ -5442,18 +5442,13 @@ Statement* Parser::FinalizeForOfStatement(ForOfStatement* loop, |
const int nopos = kNoSourcePosition; |
- // !(completion === kNormalCompletion || IS_UNDEFINED(#iterator)) |
+ // !(completion === kNormalCompletion) |
Expression* closing_condition; |
{ |
- Expression* lhs = factory()->NewCompareOperation( |
+ Expression* cmp = factory()->NewCompareOperation( |
Token::EQ_STRICT, factory()->NewVariableProxy(var_completion), |
factory()->NewSmiLiteral(Parser::kNormalCompletion, nopos), nopos); |
- Expression* rhs = factory()->NewCompareOperation( |
- Token::EQ_STRICT, factory()->NewVariableProxy(loop->iterator()), |
- factory()->NewUndefinedLiteral(nopos), nopos); |
- closing_condition = factory()->NewUnaryOperation( |
- Token::NOT, factory()->NewBinaryOperation(Token::OR, lhs, rhs, nopos), |
- nopos); |
+ closing_condition = factory()->NewUnaryOperation(Token::NOT, cmp, nopos); |
neis
2016/11/28 14:52:51
You can use NE_STRICT (!==) instead of negating EQ
|
} |
Block* final_loop = factory()->NewBlock(nullptr, 2, false, nopos); |