( unit: Unit, binding: Binding )
| 1358 | } |
| 1359 | |
| 1360 | private declarationOf( |
| 1361 | unit: Unit, |
| 1362 | binding: Binding |
| 1363 | ): [Unit, Binding] | undefined { |
| 1364 | for (let depth = 0; depth < 16; depth++) { |
| 1365 | if (binding.kind === "const" || binding.kind === "function") |
| 1366 | return unit.isSite ? undefined : [unit, binding] |
| 1367 | const specifier = binding.declaration |
| 1368 | if ( |
| 1369 | binding.kind !== "import" || |
| 1370 | specifier.type !== "ImportSpecifier" || |
| 1371 | specifier.parent?.type !== "ImportDeclaration" |
| 1372 | ) |
| 1373 | return |
| 1374 | const target = this.unitsByKey.get(specifier.parent.source.value) |
| 1375 | const exported = |
| 1376 | target?.module.scopes.exportsByName[exportNameOf(specifier.imported)] |
| 1377 | if (!target || exported?.kind !== "binding") return |
| 1378 | unit = target |
| 1379 | binding = exported.binding |
| 1380 | } |
| 1381 | } |
| 1382 | |
| 1383 | private inline(owner: Unit, binding: Binding, read: Read): boolean { |
| 1384 | const declarator = binding.declaration |
no test coverage detected