diff options
Diffstat (limited to 'js/src/tests/non262/PrivateName')
-rw-r--r-- | js/src/tests/non262/PrivateName/nested-class-in-computed-property-key.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/tests/non262/PrivateName/nested-class-in-computed-property-key.js b/js/src/tests/non262/PrivateName/nested-class-in-computed-property-key.js new file mode 100644 index 0000000000..7596dfe542 --- /dev/null +++ b/js/src/tests/non262/PrivateName/nested-class-in-computed-property-key.js @@ -0,0 +1,17 @@ +let capturedPrivateAccess; +class A { + // Declare private name in outer class. + static #x = 42; + + static [( + // Inner class in computed property key. + class {}, + + // Access to private name from outer class. + capturedPrivateAccess = () => A.#x + )]; +} +assertEq(capturedPrivateAccess(), 42); + +if (typeof reportCompare === 'function') + reportCompare(0, 0); |