v8/test/mjsunit/harmony/optional-chaining-this-private.js
Shu-yu Guo 2685658cc0 [class] Fix parenthesized calls of optional chains containing private fields
Bug: v8:10552
Change-Id: I1160ff0f9d2c91bb3c2ad3e0d5e1f36953538420
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2211402
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67959}
2020-05-25 19:04:54 +00:00

17 lines
395 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.
class C {
static #c = C;
static #m() { return this; }
static test(C) {
assertEquals(C?.#m(), C);
assertEquals((C?.#m)(), C);
assertEquals(C?.#c?.#m(), C);
assertEquals((C?.#c?.#m)(), C);
}
}
C.test(C);