Index: src/scopes.cc |
diff --git a/src/scopes.cc b/src/scopes.cc |
index 61a75ab16fcf408a0ba79355f4e43d59979564c8..039bea0987a4261432cab324cdd464e0e87939a6 100644 |
--- a/src/scopes.cc |
+++ b/src/scopes.cc |
@@ -466,22 +466,15 @@ |
bool is_rest, bool* is_duplicate) { |
DCHECK(!already_resolved()); |
DCHECK(is_function_scope()); |
- |
- Variable* var; |
- if (!name->IsEmpty()) { |
- var = variables_.Declare(this, name, mode, Variable::NORMAL, |
- kCreatedInitialized); |
- // TODO(wingo): Avoid O(n^2) check. |
- *is_duplicate = IsDeclaredParameter(name); |
- } else { |
- var = new (zone()) |
- Variable(this, name, TEMPORARY, Variable::NORMAL, kCreatedInitialized); |
- } |
+ Variable* var = variables_.Declare(this, name, mode, Variable::NORMAL, |
+ kCreatedInitialized); |
if (is_rest) { |
DCHECK_NULL(rest_parameter_); |
rest_parameter_ = var; |
rest_index_ = num_parameters(); |
} |
+ // TODO(wingo): Avoid O(n^2) check. |
+ *is_duplicate = IsDeclaredParameter(name); |
params_.Add(var, zone()); |
return var; |
} |