Closed Bug 1683784 Opened 3 years ago Closed 3 years ago

Extra `#` in error message for assigning to a private method

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: jorendorff, Assigned: jon4t4n)

References

Details

Attachments

(1 file)

It's illegal to assign to a private method. They're not properties.

But the error message is a bit off:

class C {
  #x() {}
  constructor() { this.#x = 1; }
}
new C;

TypeError: ##x is read-only

It should be #x, not ##x.

I would like to work on this bug, and I have a patch ready. Who should I set as the reviewer?

Jotan: You can assign to myself or :jorendorff!

Thanks for your interest in working on this, apologies for the delay in reply.

Flags: needinfo?(jonatan.r.klemets)
Assignee: nobody → jonatan.r.klemets
Status: NEW → ASSIGNED
Flags: needinfo?(jonatan.r.klemets)
Pushed by mgaudet@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c5fe59c15b01
Remove extra '#' in read-only error message for SymbolCode::PrivateNameSymbol. r=mgaudet
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: