[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:
parent
894cc02144
commit
bd114da7c3
@ -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);
|
||||
}
|
||||
|
6
test/mjsunit/regress/regress-908975.js
Normal file
6
test/mjsunit/regress/regress-908975.js
Normal 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
|
Loading…
Reference in New Issue
Block a user