babel / proposals

✍️ Tracking the status of Babel's implementation of TC39 proposals (may be out of date)
https://github.com/tc39/proposals
432 stars 39 forks source link

Private Static Methods (Stage 3) #55

Closed tim-mc closed 5 years ago

tim-mc commented 5 years ago

Info

Proposal Status: Stage 3 @ May 2018 TC39 meeting Meeting Slides: Status Class Features Proposal Repo: tc39/proposal-static-class-features

Article on class features subject by @syg: "The Semantics of All JS Class Elements"

Prior Work:

Example

class Account {
   // ...
  static #makeTransaction(dollars, from, to) {
    Account.#transactions = this.#transactions.concat(/* ... */);
  }

  transfer(dollars, targetAccount) {
    return Account.#makeTransaction(dollars, this, targetAccount);
  }
}

cc @robpalme @littledan @nicolo-ribaudo

tim-mc commented 5 years ago

I plan to begin putting together a WIP PR for this soon.

tim-mc commented 5 years ago

This is completed now that https://github.com/babel/babel/pull/9446 has been merged.

I'll open another issue for private static accessors.