Skip to content

Class Fields (Stage 3) #12

Open
Open
@babel-bot

Description

@babel-bot

Original issue submitted by @babel-bot in babel/babel#4408

Champions: @jeffmo (public class fields) @littledan (private + combined)
Spec Repo: https://github.com/tc39/proposal-class-fields
Spec Text: https://tc39.github.io/proposal-class-fields/
Slides: https://drive.google.com/file/d/0B-TAClBGyqSxWHpyYmg2UnRHc28/view

Moved to Stage 3 at the July 2017 meeting: https://github.com/tc39/agendas/blob/master/2017/07.md (https://twitter.com/lbljeffmo/status/890679542007738368)

Examples

class C {
  static x = 1, #y, [a];
  z, #w = 2, [b];
  
  a() {
    this.z;
    this.#w++;
    #w; // #w is this.#w
  }
}

Parsing/ESTree

  • AST handled already in current classProperties and classPrivateProperties.
  • May need to rename though (new plugin name).
  • make sure no "private computed" parse
  • need to support comma separated properties.

Transform

  • combine the class-properties plugin + tbd private properties one

Contacts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions