packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/leaked-context-get-metadata/exec.js
raw symbols SCIP| 1 | let getMetadata; |
| 2 | let metadataSymbol = Symbol(); |
| 3 | |
| 4 | function callCapturedFunc() { |
| 5 | getMetadata(metadataSymbol); |
| 6 | } |
| 7 | |
| 8 | function decMethod(_, context) { |
| 9 | ({ getMetadata } = context); |
| 10 | getMetadata(metadataSymbol); |
| 11 | } |
| 12 | |
| 13 | expect(() => { |
| 14 | class C { |
| 15 | @callCapturedFunc |
| 16 | @decMethod |
| 17 | m() {} |
| 18 | } |
| 19 | }).toThrow('attempted to call getMetadata after decoration was finished') |