ecmascript-types icon indicating copy to clipboard operation
ecmascript-types copied to clipboard

Create examples with private and static typed class members

Open sirisian opened this issue 4 years ago • 0 comments

See these proposals:

https://github.com/tc39/proposal-private-methods
https://github.com/tc39/proposal-static-class-features

I already have public fields in the document, and there's no conflicting syntax.

class A {
  a:uint8 = 0
  #b:uint8 = 0
  static #c:uint8 = 0
  get #d():uint8 { return #b; }
  set #d(value) {
    #b = value;
  }
  static #e(a:A, value:uint8) {
    a.#b = value;
  }
}

sirisian avatar Mar 21 '21 01:03 sirisian