2022-04-14 12:01:23 +08:00
|
|
|
class H {
|
|
|
|
pub_field = "Hello";
|
|
|
|
// ^ property
|
|
|
|
|
|
|
|
#priv_field = "World!";
|
|
|
|
// ^ property
|
|
|
|
|
|
|
|
#private_method() {
|
|
|
|
// ^ method
|
|
|
|
return `${this.pub_field} -- ${this.#priv_field}`;
|
|
|
|
// ^ property
|
|
|
|
// ^ property
|
|
|
|
}
|
|
|
|
|
|
|
|
public_method() {
|
|
|
|
// ^ method
|
|
|
|
return this.#private_method();
|
2023-06-18 14:17:38 +08:00
|
|
|
// ^ method.call
|
2022-04-14 12:01:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
ok() {
|
|
|
|
return this.public_method();
|
2023-06-18 14:17:38 +08:00
|
|
|
// ^ method.call
|
2022-04-14 12:01:23 +08:00
|
|
|
}
|
|
|
|
}
|
2023-06-18 14:17:38 +08:00
|
|
|
|
|
|
|
function doSomething(options) {
|
|
|
|
const {
|
|
|
|
enable: on,
|
|
|
|
// ^ punctuation.delimiter
|
|
|
|
} = options
|
|
|
|
}
|