a829781cc5
Previously we use the error message for normal invalid private member access, so for a failed brand check for class C, the error is TypeError: Cannot read private member C from an object whose class did not declare it This updates the message to TypeError: Object must be an instance of class C Bug: v8:8330 Change-Id: Ida98f46b8387631194a9b7a48bd1f419045ac6e7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2100688 Commit-Queue: Joyee Cheung <joyee@igalia.com> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Shu-yu Guo <syg@chromium.org> Cr-Commit-Position: refs/heads/master@{#66923}
12 lines
271 B
JavaScript
12 lines
271 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.
|
|
|
|
// Flags: --harmony-private-methods
|
|
|
|
class C {
|
|
#a() {}
|
|
test(obj) { obj.#a(); }
|
|
}
|
|
(new C).test({});
|