( site: Site, reference: Site["references"][number] )
| 1490 | // reading only its argument is written where it's read; any other, in its |
| 1491 | // cell's module, by a call, so nothing names it for a variable holding it |
| 1492 | private closedPredicateTextOf( |
| 1493 | site: Site, |
| 1494 | reference: Site["references"][number] |
| 1495 | ): CellText | undefined { |
| 1496 | const { value } = reference |
| 1497 | const standIn = this.standInOf(value) |
| 1498 | const node = standIn?.closure?.node |
| 1499 | const created = createdBy(site) |
| 1500 | if ( |
| 1501 | !node || |
| 1502 | !created || |
| 1503 | reference.binding || |
| 1504 | reference.start !== node.start || |
| 1505 | reference.end !== node.end || |
| 1506 | declaredNameOf(node) !== "" || |
| 1507 | // a read of its Type before its site has run throws where a site sets it |
| 1508 | this.isOnCycle(standIn!.module) || |
| 1509 | !rootsIn(created).some(root => |
| 1510 | root.references.some( |
| 1511 | ref => ref.is("predicate") && ref.predicate === value |
| 1512 | ) |
| 1513 | ) |
| 1514 | ) |
| 1515 | return |
| 1516 | return this.cellTextOf(cellNameOf(value), node, standIn!.module) |
| 1517 | } |
| 1518 | |
| 1519 | // a function's text as its cell's module holds it: what it reads of another |
| 1520 | // module is imported there from the module declaring it, under a name of |
no test coverage detected