Debian Codegraph @

packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/public/exec.js

raw symbols SCIP
1 function dec(fn, context) {
2 return function () {
3 return fn.call(this) + 1;
4 }
5 }
6
7 class Foo {
8 value = 1;
9
10 @dec
11 a() {
12 return this.value;
13 }
14
15 @dec
16 ['b']() {
17 return this.value;
18 }
19 }
20
21 let foo = new Foo();
22
23 expect(foo.a()).toBe(2);
24 expect(foo.b()).toBe(2);
25 foo.value = 123;
26 expect(foo.a()).toBe(124);
27 expect(foo.b()).toBe(124);