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

Unified Diff: src/parser.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
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index fc4aba2b9f25d76feeaea2480d180c44bbf86623..dcfe4449059d15fd16afa7c07782ad2b822d23c3 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -474,7 +474,6 @@ class Parser {
public:
FunctionState(Parser* parser,
Scope* scope,
- bool is_generator,
Isolate* isolate);
~FunctionState();
@@ -505,7 +504,17 @@ class Parser {
void AddProperty() { expected_property_count_++; }
int expected_property_count() { return expected_property_count_; }
- bool is_generator() const { return is_generator_; }
+ void set_generator_iterator_variable(Variable *variable) {
+ ASSERT(variable != NULL);
+ ASSERT(!is_generator());
+ generator_iterator_variable_ = variable;
+ }
+ Variable* generator_iterator_variable() const {
+ return generator_iterator_variable_;
+ }
+ bool is_generator() const {
+ return generator_iterator_variable_ != NULL;
+ }
AstNodeFactory<AstConstructionVisitor>* factory() { return &factory_; }
@@ -521,9 +530,6 @@ class Parser {
// Properties count estimation.
int expected_property_count_;
- // Indicates that this function is a generator.
- bool is_generator_;
-
// Keeps track of assignments to properties of this. Used for
// optimizing constructors.
bool only_simple_this_property_assignments_;
@@ -532,6 +538,7 @@ class Parser {
Parser* parser_;
FunctionState* outer_function_state_;
Scope* outer_scope_;
+ Variable* generator_iterator_variable_;
int saved_ast_node_id_;
AstNodeFactory<AstConstructionVisitor> factory_;
};

Powered by Google App Engine
This is Rietveld 408576698