a769ea7a44
AST reindexing has to skip visiting fields that are already in the member initializer, as they will have already been visited when visiting said initializer. This is the case for private fields and fields with computed names. However, the reindexer was incorrectly assuming that all properties with a FunctionLiteral value are methods (and thus not fields, and can safely be visited). This is not the case for fields with function expression values. Now, we correctly use the class property's "kind" when making this visitation decision. Fixed: chromium:1132111 Change-Id: Ia53d1fe713453e361b818dfb0b5f88a90cecdf21 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440519 Auto-Submit: Leszek Swirski <leszeks@chromium.org> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#70247}
24 lines
636 B
JavaScript
24 lines
636 B
JavaScript
// Copyright 2020 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.
|
|
|
|
// Public function field with computed name
|
|
eval(`
|
|
buggy = ((bug = new class { [0] = x => 1337.0; }) => bug);
|
|
`);
|
|
|
|
// Public method with computed name
|
|
eval(`
|
|
buggy = ((bug = new class { [0](x) { return 1337.0}; }) => bug);
|
|
`);
|
|
|
|
// Private function field with computed name
|
|
eval(`
|
|
buggy = ((bug = new class { #foo = x => 1337.0; }) => bug);
|
|
`);
|
|
|
|
// Private method with computed name
|
|
eval(`
|
|
buggy = ((bug = new class { #foo(x) { return 1337.0; } }) => bug);
|
|
`);
|