Files
test-repo/tests/format/js/babel-plugins/private-methods.js
T
09222ed6e8 Build(deps): Bump espree from 7.3.1 to 8.0.0 (#11162)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2021-07-07 18:53:09 +08:00

20 lines
387 B
JavaScript

// https://babeljs.io/docs/en/babel-plugin-proposal-private-methods
// Test for `classPrivateProperties` and `classPrivateMethods`
class Counter extends HTMLElement {
#xValue = 0;
#render() {}
get #x() { return this.#xValue; }
set #x(value) {
this.#xValue = value;
window.requestAnimationFrame(
this.#render.bind(this));
}
#clicked() {
this.#x++;
}
}