Chromium Code Reviews| Index: src/parsing/parser.h | 
| diff --git a/src/parsing/parser.h b/src/parsing/parser.h | 
| index b4bbd46937fdcffcaa33977ba52b5d8771b0b168..8e7a39aedb5dad1df1c598e54447e1dd49791d64 100644 | 
| --- a/src/parsing/parser.h | 
| +++ b/src/parsing/parser.h | 
| @@ -616,7 +616,7 @@ class ParserTraits { | 
| ClassLiteral* ParseClassLiteral(const AstRawString* name, | 
| Scanner::Location class_name_location, | 
| bool name_is_strict_reserved, int pos, | 
| - bool* ok); | 
| + bool ambient, bool* ok); | 
| V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, | 
| bool* ok); | 
| @@ -784,8 +784,9 @@ class Parser : public ParserBase<ParserTraits> { | 
| // which is set to false if parsing failed; it is unchanged otherwise. | 
| // By making the 'exception handling' explicit, we are forced to check | 
| // for failure at the call sites. | 
| - void* ParseStatementList(ZoneList<Statement*>* body, int end_token, bool* ok); | 
| - Statement* ParseStatementListItem(bool* ok); | 
| + void* ParseStatementList(ZoneList<Statement*>* body, int end_token, | 
| + bool top_level, bool* ok); | 
| 
 
rossberg
2016/04/20 15:16:34
Instead of this flag, couldn't you simply look at
 
nickie
2016/04/21 13:57:10
Depending on https://codereview.chromium.org/19067
 
 | 
| + Statement* ParseStatementListItem(bool top_level, bool* ok); | 
| void* ParseModuleItemList(ZoneList<Statement*>* body, bool* ok); | 
| Statement* ParseModuleItem(bool* ok); | 
| const AstRawString* ParseModuleSpecifier(bool* ok); | 
| @@ -806,19 +807,19 @@ class Parser : public ParserBase<ParserTraits> { | 
| Statement* ParseStatementAsUnlabelled(ZoneList<const AstRawString*>* labels, | 
| bool* ok); | 
| Statement* ParseFunctionDeclaration(ZoneList<const AstRawString*>* names, | 
| - bool* ok); | 
| + bool ambient, bool* ok); | 
| Statement* ParseFunctionDeclaration(int pos, bool is_generator, | 
| ZoneList<const AstRawString*>* names, | 
| - bool* ok); | 
| + bool ambient, bool* ok); | 
| Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names, | 
| - bool* ok); | 
| + bool ambient, bool* ok); | 
| Statement* ParseNativeDeclaration(bool* ok); | 
| Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok); | 
| Block* ParseBlock(ZoneList<const AstRawString*>* labels, | 
| bool finalize_block_scope, bool* ok); | 
| Block* ParseVariableStatement(VariableDeclarationContext var_context, | 
| ZoneList<const AstRawString*>* names, | 
| - bool* ok); | 
| + bool ambient, bool* ok); | 
| DoExpression* ParseDoExpression(bool* ok); | 
| Expression* ParseYieldStarExpression(bool* ok); | 
| @@ -942,7 +943,7 @@ class Parser : public ParserBase<ParserTraits> { | 
| Block* ParseVariableDeclarations(VariableDeclarationContext var_context, | 
| DeclarationParsingResult* parsing_result, | 
| ZoneList<const AstRawString*>* names, | 
| - bool* ok); | 
| + bool ambient, bool* ok); | 
| Statement* ParseExpressionOrLabelledStatement( | 
| ZoneList<const AstRawString*>* labels, | 
| AllowLabelledFunctionStatement allow_function, bool* ok); | 
| @@ -1006,7 +1007,7 @@ class Parser : public ParserBase<ParserTraits> { | 
| ClassLiteral* ParseClassLiteral(const AstRawString* name, | 
| Scanner::Location class_name_location, | 
| bool name_is_strict_reserved, int pos, | 
| - bool* ok); | 
| + bool ambient, bool* ok); | 
| // Magical syntax support. | 
| Expression* ParseV8Intrinsic(bool* ok); |