Index: src/parsing/preparser.h |
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h |
index d35c439619b2e8722728a1950a2c11315a9af10d..0b41e3bfe817c98ee51de84cc72ea59e267e7288 100644 |
--- a/src/parsing/preparser.h |
+++ b/src/parsing/preparser.h |
@@ -1645,7 +1645,7 @@ class PreParserTraits { |
PreParserFactory* factory = NULL); |
PreParserExpression GetIterator(PreParserExpression iterable, |
- PreParserFactory* factory) { |
+ PreParserFactory* factory, int pos) { |
return PreParserExpression::Default(); |
} |
@@ -3120,8 +3120,12 @@ ParserBase<Traits>::ParseYieldExpression(ExpressionClassifier* classifier, |
} |
if (kind == Yield::kDelegating) { |
// var iterator = subject[Symbol.iterator](); |
- expression = this->GetIterator(expression, factory()); |
+ // Hackily disambiguate o from o.next and o [Symbol.iterator](). |
+ // TODO(verwaest): Come up with a better solution. |
+ expression = this->GetIterator(expression, factory(), pos + 1); |
} |
+ // Hackily disambiguate o from o.next and o [Symbol.iterator](). |
+ // TODO(verwaest): Come up with a better solution. |
typename Traits::Type::YieldExpression yield = |
factory()->NewYield(generator_object, expression, kind, pos); |
return yield; |