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

Unified Diff: src/scopes.cc

Issue 1064433008: Re-apply formal argument, arrow function parsing refactors (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Remove stale declaration that crept in with last patch 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/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index 364f2f1cf7ce88ca08e207172c1cba1613dbb3f7..be991a1a17bc78acc8ae85aae36b4c9e45987979 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -452,7 +452,7 @@ Variable* Scope::Lookup(const AstRawString* name) {
Variable* Scope::DeclareParameter(const AstRawString* name, VariableMode mode,
- bool is_rest) {
+ bool is_rest, bool* is_duplicate) {
DCHECK(!already_resolved());
DCHECK(is_function_scope());
Variable* var = variables_.Declare(this, name, mode, Variable::NORMAL,
@@ -462,6 +462,8 @@ Variable* Scope::DeclareParameter(const AstRawString* name, VariableMode mode,
rest_parameter_ = var;
rest_index_ = num_parameters();
}
+ // TODO(wingo): Avoid O(n^2) check.
+ *is_duplicate = IsDeclaredParameter(name);
params_.Add(var, zone());
return var;
}
« src/preparser.h ('K') | « src/scopes.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698