| Index: src/parser.h
|
| diff --git a/src/parser.h b/src/parser.h
|
| index 8d557aed53eca468795303c536bbd17252890551..0c1f16a3ce31082bd1ec6af1abeab79088100aa4 100644
|
| --- a/src/parser.h
|
| +++ b/src/parser.h
|
| @@ -557,6 +557,7 @@ class ParserTraits {
|
| typedef ObjectLiteral::Property* ObjectLiteralProperty;
|
| typedef ZoneList<v8::internal::Expression*>* ExpressionList;
|
| typedef ZoneList<ObjectLiteral::Property*>* PropertyList;
|
| + typedef const v8::internal::AstRawString* FormalParameter;
|
| typedef ZoneList<v8::internal::Statement*>* StatementList;
|
|
|
| // For constructing objects returned by the traversing functions.
|
| @@ -694,7 +695,6 @@ class ParserTraits {
|
| static Expression* EmptyExpression() {
|
| return NULL;
|
| }
|
| - static Expression* EmptyArrowParamList() { return NULL; }
|
| static Literal* EmptyLiteral() {
|
| return NULL;
|
| }
|
| @@ -705,6 +705,7 @@ class ParserTraits {
|
| static ZoneList<Expression*>* NullExpressionList() {
|
| return NULL;
|
| }
|
| + static const AstRawString* EmptyFormalParameter() { return NULL; }
|
|
|
| // Non-NULL empty string.
|
| V8_INLINE const AstRawString* EmptyIdentifierString();
|
| @@ -743,11 +744,24 @@ class ParserTraits {
|
| V8_INLINE Scope* NewScope(Scope* parent_scope, ScopeType scope_type,
|
| FunctionKind kind = kNormalFunction);
|
|
|
| - // Utility functions
|
| - int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope,
|
| - Scanner::Location* undefined_loc,
|
| - Scanner::Location* dupe_loc,
|
| - bool* ok);
|
| + void DeclareFormalParameter(Scope* scope, const AstRawString* name,
|
| + bool is_rest) {
|
| + Variable* var = scope->DeclareParameter(name, VAR, is_rest);
|
| + if (is_sloppy(scope->language_mode())) {
|
| + // TODO(sigurds) Mark every parameter as maybe assigned. This is a
|
| + // conservative approximation necessary to account for parameters
|
| + // that are assigned via the arguments array.
|
| + var->set_maybe_assigned();
|
| + }
|
| + }
|
| +
|
| + void DeclareArrowFunctionParameters(Scope* scope, Expression* expr,
|
| + const Scanner::Location& params_loc,
|
| + FormalParameterErrorLocations* error_locs,
|
| + bool* ok);
|
| + void ParseArrowFunctionFormalParameters(
|
| + Scope* scope, Expression* params, const Scanner::Location& params_loc,
|
| + FormalParameterErrorLocations* error_locs, bool* is_rest, bool* ok);
|
|
|
| // Temporary glue; these functions will move to ParserBase.
|
| Expression* ParseV8Intrinsic(bool* ok);
|
| @@ -1045,8 +1059,6 @@ class Parser : public ParserBase<ParserTraits> {
|
| ScriptCompiler::CompileOptions compile_options_;
|
| ParseData* cached_parse_data_;
|
|
|
| - bool parsing_lazy_arrow_parameters_; // for lazily parsed arrow functions.
|
| -
|
| PendingCompilationErrorHandler pending_error_handler_;
|
|
|
| // Other information which will be stored in Parser and moved to Isolate after
|
|
|