Closed Bug 1499448 (es-fields) Opened Last year Closed 5 months ago

Implement public instance fields proposal


(Core :: JavaScript Engine, enhancement, P2)




Tracking Status
firefox65 --- wontfix
firefox66 --- wontfix


(Reporter: khyperia, Assigned: khyperia)


(Depends on 1 open bug, Blocks 3 open bugs)


(Keywords: dev-doc-complete)


(3 files, 1 obsolete file)

This bug is to track implementation of the public and private instance fields proposal (currently stage 3):
This new syntax should be added to jsfunfuzz. It should always trigger SyntaxErrors, for now.
Flags: needinfo?(nth10sd)
Duplicate of this bug: 1435824
I'll endeavour to add the private identifier "#" once this lands.
Flags: needinfo?(nth10sd)
Gary, that's not all! There's also new syntax in classes to declare both public and private fields:

    class MyClass {
        field1 = "value1";  // <-- a public field
        #field2 = 12345;  // <-- a private field
        field3;  // <-- public field (initializer is optional, defaults to undefined)
        #field4 // <-- private field, no initializer, automatic semicolon insertion
Thanks! That's helpful. I suppose both public fields and private fields are only applicable wrt. classes?
Keywords: checkin-needed
Pushed by
Implement syntax for public and private fields. r=jorendorff
Keywords: checkin-needed
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Resolution: FIXED → ---
Priority: -- → P2
Duplicate of this bug: 1414049
Notes for MDN writer's team:

I've looked into our current documentation for this, and it looks like we have some mention of it here:

However, it could do with better documentation.

I'm not sure it is worth documenting now. It doesn't seem to be supported anywhere yet (I could be wrong, but I did try testing it).

I've therefore not added a note to the Fx65 rel notes. I'd recommend waiting until it is enabled by default in Fx, or at least until Chrome enables it.
Public class fields will be enabled by default in next stable version of Chrome in (Jan 29)
Neil Kakkar ( is currently writing the class fields documentation. If you have any suggestions for what can be improved about the current state, we'd love to hear it.
Attachment #9035998 - Attachment description: Bug 1499448: WIP patch for fields → Bug 1499448 - WIP patch for fields
Attachment #9035998 - Attachment description: Bug 1499448 - WIP patch for fields → Bug 1499448 - Implement more field functionality.
Pushed by
Implement more field functionality. r=jorendorff
Blocks: 1473796
Blocks: 1520996
Depends on: 1529758
Depends on: 1529772
Pushed by
Implement more field functionality. r=jorendorff

Ah, never cleared the needinfo, whoops. Found the issue and commented in the phabricator patch.

Flags: needinfo?(khyperia)
Closed: Last year10 months ago
Resolution: --- → FIXED
Depends on: 1530084

This is becoming the meta bug for fields in JS; work should happen in bugs that block this.

Alias: es-fields
Resolution: FIXED → ---
Depends on: 1530148
Depends on: 1530832
Pushed by
Implement .initializers local variable. r=jorendorff
Duplicate of this bug: 1530731
Closed: 10 months ago9 months ago
Resolution: --- → FIXED
Attachment #9044018 - Attachment is obsolete: true
Depends on: 1531285
Resolution: FIXED → ---

Backed out changeset 70eb46335a2c (bug 1499448) on request by jorendorff


Flags: needinfo?(jorendorff)
Flags: needinfo?(jorendorff)
Target Milestone: mozilla65 → ---
Depends on: 1532921
Depends on: 1534721
Depends on: 1535166
Depends on: 1535462
Depends on: 1535471
Depends on: 1540228
Depends on: 1540243
Depends on: 1540244
Depends on: 1540793
Depends on: 1540787
No longer depends on: 1540787
Depends on: 1541616
Depends on: 1541641
Depends on: 1540324
Depends on: 1542406
Depends on: 1542448
Type: defect → enhancement
Depends on: 1552022
Depends on: 1552229
Depends on: 1552875
Depends on: 1555037
Depends on: 1553744
Depends on: 1555464

We merged public instance fields! Woohoo!

Public static fields: bug 1535804
Private instance fields: bug 1562054

Closed: 9 months ago5 months ago
Resolution: --- → FIXED
Summary: Implement public and private instance fields proposal → Implement public instance fields proposal

We've updated docs for this when public fields were enabled in 69, see

You need to log in before you can comment on or make changes to this bug.