Index: src/parser.h |
diff --git a/src/parser.h b/src/parser.h |
index 58253e1bb6919309a444864f10bfff904efb837f..7c26755295bc2e311bb9e48eb3d5e3c1af0ba1a4 100644 |
--- a/src/parser.h |
+++ b/src/parser.h |
@@ -746,9 +746,10 @@ class ParserTraits { |
FunctionKind kind = kNormalFunction); |
bool DeclareFormalParameter(Scope* scope, const AstRawString* name, |
- bool is_rest) { |
+ bool is_rest, int pos) { |
bool is_duplicate = false; |
- Variable* var = scope->DeclareParameter(name, VAR, is_rest, &is_duplicate); |
+ Variable* var = |
+ scope->DeclareParameter(name, VAR, pos, is_rest, &is_duplicate); |
if (is_sloppy(scope->language_mode())) { |
// TODO(sigurds) Mark every parameter as maybe assigned. This is a |
// conservative approximation necessary to account for parameters |
@@ -977,7 +978,8 @@ class Parser : public ParserBase<ParserTraits> { |
Scope* inner_scope, bool is_const, ZoneList<const AstRawString*>* names, |
ForStatement* loop, Statement* init, Expression* cond, Statement* next, |
Statement* body, bool* ok); |
- |
+ ZoneList<Statement*>* DesugarInitializeParameters( |
+ Scope* scope, bool has_initializers, ZoneList<Expression*>* initializers); |
FunctionLiteral* ParseFunctionLiteral( |
const AstRawString* name, Scanner::Location function_name_location, |
bool name_is_strict_reserved, FunctionKind kind, |
@@ -1009,7 +1011,18 @@ class Parser : public ParserBase<ParserTraits> { |
// Parser support |
VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode); |
- Variable* Declare(Declaration* declaration, bool resolve, bool* ok); |
+ Variable* Declare(Declaration* declaration, bool resolve, |
+ bool allow_redeclaration, bool* ok); |
+ Variable* Declare(Declaration* declaration, bool resolve, |
+ bool allow_redeclaration) { |
+ bool ok = true; |
+ Variable* var = Declare(declaration, resolve, allow_redeclaration, &ok); |
+ DCHECK(ok); |
+ return var; |
+ } |
+ Variable* Declare(Declaration* declaration, bool resolve, bool* ok) { |
+ return Declare(declaration, resolve, false, ok); |
+ } |
bool TargetStackContainsLabel(const AstRawString* label); |
BreakableStatement* LookupBreakTarget(const AstRawString* label, bool* ok); |