Closed Bug 1986186 Opened 2 months ago Closed 1 month ago

Incorrect Proxy receiver when using private properties in target class (when run in console/debugger)

Categories

(Core :: JavaScript Engine, defect, P3)

Firefox 142
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: d9151330773, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.

Component: Untriaged → JavaScript Engine
Product: Firefox → Core

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

Summary: Incorrect Proxy receiver when using private properties in target class → Incorrect Proxy receiver when using private properties in target class (when run in console/debugger)

I will try and take a look

Blocks: sm-runtime
Severity: -- → S3
Flags: needinfo?(mgaudet)
Priority: -- → P3

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)

Flags: needinfo?(mgaudet) → needinfo?(mayankleoboy1)

when run as HTML : Bar true
When run directly in console: Bar true

Flags: needinfo?(mayankleoboy1)

(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.

Ok. I'm going to close this as WORKSFORME for now, and we'll see if we get any more information.

Status: UNCONFIRMED → RESOLVED
Closed: 1 month ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: