summaryrefslogtreecommitdiff
path: root/tests/query/highlights/ecma/test.ts
blob: d35cf827259de36009d0926b35d8cf755f7e98b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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();
    //                ^ method.call
  }

  ok() {
    return this.public_method();
    //                ^ method.call
  }
}

function doSomething(options) {
  const {
    enable: on,
    //    ^ punctuation.delimiter
  } = options
}