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

Unified Diff: src/preparser.cc

Issue 1127063003: [es6] implement default parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 95339dac33ca08b6b87bdf4bfed467c294a93280..7de6a52220245a692d9e82527a962e82e42be467 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -1006,10 +1006,13 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
int start_position = scanner()->location().beg_pos;
function_scope->set_start_position(start_position);
int num_parameters;
+ bool has_initializers = false;
{
DuplicateFinder duplicate_finder(scanner()->unicode_cache());
- num_parameters = ParseFormalParameterList(&duplicate_finder, &error_locs,
- &is_rest, CHECK_OK);
+ PreParserExpressionList initializers = NewExpressionList(0, zone());
+ num_parameters =
+ ParseFormalParameterList(&duplicate_finder, &error_locs, initializers,
+ &has_initializers, &is_rest, CHECK_OK);
}
Expect(Token::RPAREN, CHECK_OK);
int formals_end_position = scanner()->location().end_pos;

Powered by Google App Engine
This is Rietveld 408576698