[parser] Set rewritable_length to the correct length rather than 0

Bug: chromium:908975
Change-Id: I3dd9cf32de5b11554c2e1cbc0538c9b11ecda09d
Reviewed-on: https://chromium-review.googlesource.com/c/1352286
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57892}
This commit is contained in:
Toon Verwaest 2018-11-28 09:14:54 +01:00 committed by Commit Bot
parent 894cc02144
commit bd114da7c3
2 changed files with 8 additions and 1 deletions

View File

@ -1745,7 +1745,8 @@ ParserBase<Impl>::ParsePrimaryExpression() {
if (peek() == Token::ARROW) {
scope_snapshot_ = std::move(Scope::Snapshot(scope()));
rewritable_length_ = 0;
rewritable_length_ = static_cast<int>(
function_state_->destructuring_assignments_to_rewrite().size());
}
return impl()->ExpressionFromIdentifier(name, beg_pos, infer);
}

View File

@ -0,0 +1,6 @@
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[] = [];
a => 0