diff options
Diffstat (limited to 'js/src/jit-test/tests/debug/private-methods-eval-in-frame.js')
-rw-r--r-- | js/src/jit-test/tests/debug/private-methods-eval-in-frame.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/private-methods-eval-in-frame.js b/js/src/jit-test/tests/debug/private-methods-eval-in-frame.js new file mode 100644 index 0000000000..a8fd1d9583 --- /dev/null +++ b/js/src/jit-test/tests/debug/private-methods-eval-in-frame.js @@ -0,0 +1,25 @@ +// |jit-test| --enable-private-fields; --enable-private-methods; +load(libdir + 'asserts.js'); +load(libdir + 'evalInFrame.js'); + +class B { + #priv() { + return 12; + } + + #val = ''; + set #x(x) { + this.#val = x + ' haha'; + } + get #x() { + return this.#val; + } + + ef(str) { + return evalInFrame(0, str); + } +} + +var b = new B(); +assertEq(b.ef(`this.#priv();`), 12); +assertEq(b.ef(`this.#x = 'Hi'; this.#x`), 'Hi haha'); |