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

Unified Diff: src/parser.h

Issue 1311163002: [es6] Correct length for functions with default parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment Created 5 years, 4 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 | « no previous file | src/scopes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698