Files
test-repo/tests/format/js/babel-plugins/private-methods.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
384 B
JavaScript
Raw Normal View History

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