packages/babel-plugin-proposal-private-methods/test/fixtures/private-method-loose/super/exec.js
raw| 1 | class Base { |
| 2 | superMethod() { |
| 3 | return 'good'; |
| 4 | } |
| 5 | } |
| 6 | |
| 7 | class Sub extends Base { |
| 8 | superMethod() { |
| 9 | return 'bad'; |
| 10 | } |
| 11 | |
| 12 | #privateMethod() { |
| 13 | return super.superMethod(); |
| 14 | } |
| 15 | |
| 16 | publicMethod() { |
| 17 | return this.#privateMethod(); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | expect((new Sub()).publicMethod()).toEqual('good'); |