| Index: src/parser.h
|
| diff --git a/src/parser.h b/src/parser.h
|
| index 0f85f91583b161ceab4d80d6cd81b570f144f6d9..f0319d5de85808f03f86f5bd8b309f66cabf9285 100644
|
| --- a/src/parser.h
|
| +++ b/src/parser.h
|
| @@ -479,6 +479,7 @@ class Parser {
|
| public:
|
| FunctionState(Parser* parser,
|
| Scope* scope,
|
| + bool is_generator,
|
| Isolate* isolate);
|
| ~FunctionState();
|
|
|
| @@ -509,6 +510,8 @@ class Parser {
|
| void AddProperty() { expected_property_count_++; }
|
| int expected_property_count() { return expected_property_count_; }
|
|
|
| + bool is_generator() const { return is_generator_; }
|
| +
|
| AstNodeFactory<AstConstructionVisitor>* factory() { return &factory_; }
|
|
|
| private:
|
| @@ -523,6 +526,9 @@ 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_;
|
| @@ -636,6 +642,7 @@ class Parser {
|
|
|
| Expression* ParseExpression(bool accept_IN, bool* ok);
|
| Expression* ParseAssignmentExpression(bool accept_IN, bool* ok);
|
| + Expression* ParseYieldExpression(bool* ok);
|
| Expression* ParseConditionalExpression(bool accept_IN, bool* ok);
|
| Expression* ParseBinaryExpression(int prec, bool accept_IN, bool* ok);
|
| Expression* ParseUnaryExpression(bool* ok);
|
| @@ -679,6 +686,7 @@ class Parser {
|
| ZoneList<Expression*>* ParseArguments(bool* ok);
|
| FunctionLiteral* ParseFunctionLiteral(Handle<String> var_name,
|
| bool name_is_reserved,
|
| + bool is_generator,
|
| int function_token_position,
|
| FunctionLiteral::Type type,
|
| bool* ok);
|
| @@ -708,6 +716,8 @@ class Parser {
|
| return scanner().Next();
|
| }
|
|
|
| + bool is_generator() const { return current_function_state_->is_generator(); }
|
| +
|
| bool peek_any_identifier();
|
|
|
| INLINE(void Consume(Token::Value token));
|
|
|