Commit ded4cae2 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[parsing] Fix rest parameter handling in preparser.

Since preparser creates different scopes than the parser, the invariant "at most one rest parameter" doesn't hold when the rest param is a destructuring param.

No new tests added; the problem is visible w/ existing tests with FLAG_lazy_inner_functions on.

R=​vogelheim@chromium.org
BUG=chromium:690919

Change-Id: I525b8dfee92acd0733702c5a940a1a83a94712df
Reviewed-on: https://chromium-review.googlesource.com/440925Reviewed-by: 's avatarDaniel Vogelheim <vogelheim@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43117}
parent 53c11006
...@@ -974,7 +974,7 @@ Variable* DeclarationScope::DeclareParameterName( ...@@ -974,7 +974,7 @@ Variable* DeclarationScope::DeclareParameterName(
AstValueFactory* ast_value_factory) { AstValueFactory* ast_value_factory) {
DCHECK(!already_resolved_); DCHECK(!already_resolved_);
DCHECK(is_function_scope() || is_module_scope()); DCHECK(is_function_scope() || is_module_scope());
DCHECK(!has_rest_); DCHECK(!has_rest_ || is_rest);
DCHECK(is_being_lazily_parsed_); DCHECK(is_being_lazily_parsed_);
has_rest_ = is_rest; has_rest_ = is_rest;
if (name == ast_value_factory->arguments_string()) { if (name == ast_value_factory->arguments_string()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment