({ stage, n })
| 12 | }); |
| 13 | |
| 14 | function main({ stage, n }) { |
| 15 | const arr = [new vm.SourceTextModule(` |
| 16 | export const value = 42; |
| 17 | `)]; |
| 18 | |
| 19 | if (stage === 'all') { |
| 20 | bench.start(); |
| 21 | } |
| 22 | |
| 23 | for (let i = 0; i < n; i++) { |
| 24 | const m = new vm.SourceTextModule(` |
| 25 | export { value } from 'mod${i}'; |
| 26 | `); |
| 27 | arr.push(m); |
| 28 | m.linkRequests([arr[i]]); |
| 29 | } |
| 30 | |
| 31 | if (stage === 'instantiate') { |
| 32 | bench.start(); |
| 33 | } |
| 34 | arr[n].instantiate(); |
| 35 | if (stage === 'instantiate') { |
| 36 | bench.end(n); |
| 37 | } |
| 38 | |
| 39 | if (stage === 'evaluate') { |
| 40 | bench.start(); |
| 41 | } |
| 42 | arr[n].evaluate(); |
| 43 | if (stage === 'evaluate' || stage === 'all') { |
| 44 | bench.end(n); |
| 45 | } |
| 46 | |
| 47 | assert.strictEqual(arr[n].namespace.value, 42); |
| 48 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…