Index: src/ast/scopes.cc |
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc |
index 6e366b014c234d983e58a811a0ae652a3ee5e277..7e84ba6ccf718f252d62de51cf00a60bccd323d2 100644 |
--- a/src/ast/scopes.cc |
+++ b/src/ast/scopes.cc |
@@ -1252,6 +1252,7 @@ void DeclarationScope::ResetAfterPreparsing(AstValueFactory* ast_value_factory, |
DCHECK(is_function_scope()); |
// Reset all non-trivial members. |
+ params_.Clear(); |
decls_.Clear(); |
locals_.Clear(); |
sloppy_block_function_map_.Clear(); |
@@ -1260,28 +1261,8 @@ void DeclarationScope::ResetAfterPreparsing(AstValueFactory* ast_value_factory, |
inner_scope_ = nullptr; |
unresolved_ = nullptr; |
- // TODO(verwaest): We should properly preparse the parameters (no declarations |
- // should be created), and reparse on abort. |
- if (aborted) { |
- if (!IsArrowFunction(function_kind_)) { |
- DeclareDefaultFunctionVariables(ast_value_factory); |
- } |
- // Recreate declarations for parameters. |
- for (int i = 0; i < params_.length(); i++) { |
- Variable* var = params_[i]; |
- if (var->mode() == TEMPORARY) { |
- // TODO(verwaest): Remove and unfriend DeclarationScope from Variable. |
- *var->next() = nullptr; |
- locals_.Add(var); |
- } else if (variables_.Lookup(var->raw_name()) == nullptr) { |
- // TODO(verwaest): Remove and unfriend DeclarationScope from Variable. |
- *var->next() = nullptr; |
- variables_.Add(zone(), var); |
- locals_.Add(var); |
- } |
- } |
- } else { |
- params_.Rewind(0); |
+ if (aborted && !IsArrowFunction(function_kind_)) { |
+ DeclareDefaultFunctionVariables(ast_value_factory); |
} |
#ifdef DEBUG |