summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/harmony/private-accessors.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/harmony/private-accessors.js')
-rw-r--r--deps/v8/test/mjsunit/harmony/private-accessors.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/harmony/private-accessors.js b/deps/v8/test/mjsunit/harmony/private-accessors.js
index 3a828116a1..44ec2a0790 100644
--- a/deps/v8/test/mjsunit/harmony/private-accessors.js
+++ b/deps/v8/test/mjsunit/harmony/private-accessors.js
@@ -83,6 +83,30 @@
assertEquals('d', new C().getA().getD());
}
+{
+ assertThrows(() => {
+ class A {
+ [this.#a] = 1;
+ get #a() {}
+ }
+ }, TypeError);
+
+ assertThrows(() => {
+ class A {
+ [this.#a] = 1;
+ set #a(val) {}
+ }
+ }, TypeError);
+
+ assertThrows(() => {
+ class A {
+ [this.#a] = 1;
+ set #a(val) {}
+ get #a() {}
+ }
+ }, TypeError);
+}
+
// Duplicate private accessors.
// https://tc39.es/proposal-private-methods/#sec-static-semantics-early-errors
{