()
| 100 | } |
| 101 | |
| 102 | async function circular2() { |
| 103 | const sourceMap = { |
| 104 | 'root': ` |
| 105 | import * as a from './a.mjs'; |
| 106 | import * as b from './b.mjs'; |
| 107 | if (!('fromA' in a)) |
| 108 | throw new Error(); |
| 109 | if (!('fromB' in a)) |
| 110 | throw new Error(); |
| 111 | if (!('fromA' in b)) |
| 112 | throw new Error(); |
| 113 | if (!('fromB' in b)) |
| 114 | throw new Error(); |
| 115 | `, |
| 116 | './a.mjs': ` |
| 117 | export * from './b.mjs'; |
| 118 | export let fromA; |
| 119 | `, |
| 120 | './b.mjs': ` |
| 121 | export * from './a.mjs'; |
| 122 | export let fromB; |
| 123 | ` |
| 124 | }; |
| 125 | const moduleMap = new Map(); |
| 126 | const rootModule = new SourceTextModule(sourceMap.root, { |
| 127 | identifier: 'vm:root', |
| 128 | }); |
| 129 | async function link(specifier, referencingModule) { |
| 130 | if (moduleMap.has(specifier)) { |
| 131 | return moduleMap.get(specifier); |
| 132 | } |
| 133 | const mod = new SourceTextModule(sourceMap[specifier], { |
| 134 | identifier: new URL(specifier, 'file:///').href, |
| 135 | }); |
| 136 | moduleMap.set(specifier, mod); |
| 137 | return mod; |
| 138 | } |
| 139 | await rootModule.link(link); |
| 140 | await rootModule.evaluate(); |
| 141 | } |
| 142 | |
| 143 | async function asserts() { |
| 144 | const m = new SourceTextModule(` |
no test coverage detected
searching dependent graphs…