Incorrect Proxy receiver when using private properties in target class (when run in console/debugger)
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
People
(Reporter: d9151330773, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
173.78 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15
Steps to reproduce:
class X {
constructor() {
return new Proxy(this, {})
}
}
class Bar extends X {
#bar = 1;
#x = new Set;
baz = 1;
foo() {
return this.#bar === 1
}
}
const b = new Bar;
console.log('Bar', b.foo())
Actual results:
Console output is undefined
Expected results:
The console output should be 1.
This work in Chromium based browsers, in nodejs, in deno and Safari. But in Firefox result is undefined.
Comment 1•2 months ago
|
||
I get Bar true
when run as a HTML.
When run in debugger/console I get
21:55:09.910 Bar true debugger eval code:20:9
21:55:09.911 undefined
Comment 2•2 months ago
|
||
I will try and take a look
Comment 3•1 month ago
|
||
I cannot reproduce this anymore. (Also, the test case doesn't quite match the report; it should print Bar true -- in no place in the test case should it print 1)
Mayank, can you also check?
(the undefined is just the return value of console.log)
Comment 4•1 month ago
|
||
when run as HTML : Bar true
When run directly in console: Bar true
Reporter | ||
Comment 5•1 month ago
|
||
(In reply to Matthew Gaudet (he/him) [:mgaudet] from comment #3)
I cannot reproduce this anymore. (Also, the test case doesn't quite match the report; it should print Bar true -- in no place in the test case should it print 1)
Mayank, can you also check?
(the undefined is just the return value of console.log)
Interesting. I haven't updated Firefox, I'm still on version 142, but it's working now. I still can't see the private properties themselves in the console, but I get Bar true as expected.
Comment 6•1 month ago
|
||
Ok. I'm going to close this as WORKSFORME for now, and we'll see if we get any more information.
Description
•