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

Unified Diff: src/parser.cc

Issue 1414283002: [es6] Fix scoping for default parameters in arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 2 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/parameter-initializer-rewriter.cc ('k') | src/pattern-rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 666b7043468d590852ea2b914d3fc175ba39718e..f0affc27985c5e8b68f7bfbd3e94755e9cb96426 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -14,6 +14,7 @@
#include "src/codegen.h"
#include "src/compiler.h"
#include "src/messages.h"
+#include "src/parameter-initializer-rewriter.h"
#include "src/preparser.h"
#include "src/rewriter.h"
#include "src/runtime/runtime.h"
@@ -4049,6 +4050,10 @@ void ParserTraits::ParseArrowFunctionFormalParameters(
DCHECK(!assignment->is_compound());
initializer = assignment->value();
expr = assignment->target();
+
+ // TODO(adamk): Only call this if necessary.
+ RewriteParameterInitializerScope(parser_->stack_limit(), initializer,
+ parser_->scope_, parameters->scope);
}
AddFormalParameter(parameters, expr, initializer, is_rest);
« no previous file with comments | « src/parameter-initializer-rewriter.cc ('k') | src/pattern-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698