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

Unified Diff: src/ast.h

Issue 13542002: Calling a generator function returns a generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Link generator iterator definitions and uses through local variable Created 7 years, 9 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 | « no previous file | src/factory.h » ('j') | src/objects.h » ('J')
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 dddfc835fd284d400973b7c9cd994c3627bbeac7..f8617e3cb7113f80b66472f2191f10339e3c6a14 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -1962,21 +1962,25 @@ class Yield: public Expression {
public:
DECLARE_NODE_TYPE(Yield)
+ Expression* iterator() const { return iterator_; }
Expression* expression() const { return expression_; }
bool is_delegating_yield() const { return is_delegating_yield_; }
virtual int position() const { return pos_; }
protected:
Yield(Isolate* isolate,
+ Expression* iterator,
Expression* expression,
bool is_delegating_yield,
int pos)
: Expression(isolate),
+ iterator_(iterator),
expression_(expression),
is_delegating_yield_(is_delegating_yield),
pos_(pos) { }
private:
+ Expression* iterator_;
Expression* expression_;
bool is_delegating_yield_;
int pos_;
@@ -2958,9 +2962,10 @@ class AstNodeFactory BASE_EMBEDDED {
VISIT_AND_RETURN(Assignment, assign)
}
- Yield* NewYield(Expression* expression, bool is_delegating_yield, int pos) {
- Yield* yield =
- new(zone_) Yield(isolate_, expression, is_delegating_yield, pos);
+ Yield* NewYield(Expression *iterator, Expression* expression,
+ bool is_delegating_yield, int pos) {
+ Yield* yield = new(zone_) Yield(isolate_, iterator, expression,
+ is_delegating_yield, pos);
VISIT_AND_RETURN(Yield, yield)
}
« no previous file with comments | « no previous file | src/factory.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698