Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: src/ast.h

Issue 332663004: For-of calls [Symbol.iterator]() on RHS to get iterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/array-iterator.js ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 0882b250ffde424f2f86925d1416c4fa54288f54..f79c2d2b2b0ce1391b64cd4806d4d42e321ba112 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -956,11 +956,13 @@ class ForOfStatement V8_FINAL : public ForEachStatement {
void Initialize(Expression* each,
Expression* subject,
Statement* body,
+ Expression* assign_iterable,
Expression* assign_iterator,
Expression* next_result,
Expression* result_done,
Expression* assign_each) {
ForEachStatement::Initialize(each, subject, body);
+ assign_iterable_ = assign_iterable;
assign_iterator_ = assign_iterator;
next_result_ = next_result;
result_done_ = result_done;
@@ -971,7 +973,12 @@ class ForOfStatement V8_FINAL : public ForEachStatement {
return subject();
}
- // var iterator = iterable;
+ // var iterable = subject;
+ Expression* assign_iterable() const {
+ return assign_iterable_;
+ }
+
+ // var iterator = iterable[Symbol.iterator]();
Expression* assign_iterator() const {
return assign_iterator_;
}
@@ -1006,6 +1013,7 @@ class ForOfStatement V8_FINAL : public ForEachStatement {
back_edge_id_(GetNextId(zone)) {
}
+ Expression* assign_iterable_;
Expression* assign_iterator_;
Expression* next_result_;
Expression* result_done_;
« no previous file with comments | « src/array-iterator.js ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698