Index: src/parser.h |
diff --git a/src/parser.h b/src/parser.h |
index 355778b042d3368b3f340cc58f08a357bc7879a4..8f0d440f3cabccfd785796ea02ca1770cd1cf3a0 100644 |
--- a/src/parser.h |
+++ b/src/parser.h |
@@ -1341,8 +1341,9 @@ void ParserTraits::DeclareFormalParameter( |
auto name = is_simple || parameter.is_rest |
? parameter.name : parser_->ast_value_factory()->empty_string(); |
auto mode = is_simple || parameter.is_rest ? VAR : TEMPORARY; |
- Variable* var = |
- scope->DeclareParameter(name, mode, parameter.is_rest, &is_duplicate); |
+ bool is_optional = parameter.initializer != nullptr; |
+ Variable* var = scope->DeclareParameter( |
+ name, mode, is_optional, parameter.is_rest, &is_duplicate); |
if (is_duplicate) { |
classifier->RecordDuplicateFormalParameterError( |
parser_->scanner()->location()); |