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

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: 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
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 2b61853b0c35db347cb8d4c970d422a1ed576240..3f8d600af4d1c81e25d1d7c7a771909df7de5023 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -1196,6 +1196,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,
@@ -3075,10 +3076,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);

Powered by Google App Engine
This is Rietveld 408576698