packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/initProto-existing-derived-constructor/exec.js
raw symbols SCIP| 1 | let self, a, initCalled; |
| 2 | |
| 3 | function deco(_, context) { |
| 4 | context.addInitializer(() => { |
| 5 | initCalled = true; |
| 6 | }) |
| 7 | } |
| 8 | |
| 9 | class B { |
| 10 | constructor(s) { |
| 11 | a = s; |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | class A extends B { |
| 16 | constructor() { |
| 17 | let a = 2; |
| 18 | self = super(a); |
| 19 | } |
| 20 | |
| 21 | @deco |
| 22 | method() {} |
| 23 | } |
| 24 | |
| 25 | let instance = new A(); |
| 26 | expect(self).toBe(instance); |
| 27 | expect(a).toBe(2); |
| 28 | expect(initCalled).toBe(true); |