Skip to content

Private Methods (and accessors) (Stage 3) #22

@hzoo

Description

@hzoo

Champions: Daniel Ehrenberg @littledan
Spec Repo: https://github.com/littledan/proposal-private-methods
First presented at the July 2017 meeting: https://github.com/tc39/agendas/blob/master/2017/07.md
Moved to Stage 3 at the Sept 2017 meeting: https://docs.google.com/presentation/d/1aI89Jgl7CdtKV6D5-ydieUn_-kgRqAD2X8gGzh62xzc/edit#slide=id.p

Example:

class Counter extends HTMLElement {
  #xValue = 0;

  get #x() { return this.#xValue; }
  set #x(value) {
    this.#xValue = value; 
    window.requestAnimationFrame(
      this.#render.bind(this));
  }

  #clicked() {
    this.#x++;
  }
}

Implementation

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