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

Unified Diff: src/preparser.h

Issue 1053773006: [es6] implement default/optional parameters (WIP / comments) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Experimental not-quite-TDZ support Created 5 years, 8 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
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index a7c27c1c649153dc250bbadb3b005c5d75bcdc69..76399af44a00f62006b6372e97c1e7247f92c0a6 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -1237,6 +1237,7 @@ class PreParserFactory {
PreParserIdentifier name, AstValueFactory* ast_value_factory,
Scope* scope, PreParserStatementList body, int materialized_literal_count,
int expected_property_count, int handler_count, int parameter_count,
+ PreParserExpressionList default_values,
FunctionLiteral::ParameterFlag has_duplicate_parameters,
FunctionLiteral::FunctionType function_type,
FunctionLiteral::IsFunctionFlag is_function,
@@ -3130,10 +3131,12 @@ ParserBase<Traits>::ParseArrowFunctionLiteral(int start_pos,
}
}
+ typename Traits::Type::ExpressionList default_values =
+ this->NewExpressionList(0, zone_);
FunctionLiteralT function_literal = factory()->NewFunctionLiteral(
this->EmptyIdentifierString(), ast_value_factory(), scope, body,
materialized_literal_count, expected_property_count, handler_count,
- num_parameters, FunctionLiteral::kNoDuplicateParameters,
+ num_parameters, default_values, FunctionLiteral::kNoDuplicateParameters,
FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction,
FunctionLiteral::kNotParenthesized, FunctionKind::kArrowFunction,
start_pos);
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698