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; |
} |