* Describe a synthesized (dynamic-dispatch) edge for human output: how the * callback was wired up — the bridge static parsing can't see. Returns null * for ordinary static edges. Used by trace + the node trail so a synthesized * hop reads as "registered via onUpdate at App.tsx:3148", not a
(edge: Edge | null)
| 1780 | * hop reads as "registered via onUpdate at App.tsx:3148", not a bare arrow. |
| 1781 | */ |
| 1782 | private synthEdgeNote(edge: Edge | null): { label: string; compact: string; registeredAt?: string } | null { |
| 1783 | if (!edge || edge.provenance !== 'heuristic') return null; |
| 1784 | const m = edge.metadata as Record<string, unknown> | undefined; |
| 1785 | const registeredAt = typeof m?.registeredAt === 'string' ? m.registeredAt : undefined; |
| 1786 | const at = registeredAt ? ` @${registeredAt}` : ''; |
| 1787 | if (m?.synthesizedBy === 'callback') { |
| 1788 | const via = m.via ? `\`${String(m.via)}\`` : 'a registrar'; |
| 1789 | const field = m.field ? ` on .${String(m.field)}` : ''; |
| 1790 | return { |
| 1791 | label: `callback — registered via ${via}${field} (dynamic dispatch)`, |
| 1792 | compact: `dynamic: callback via ${via}${at}`, |
| 1793 | registeredAt, |
| 1794 | }; |
| 1795 | } |
| 1796 | if (m?.synthesizedBy === 'event-emitter') { |
| 1797 | const ev = m.event ? `\`${String(m.event)}\`` : 'an event'; |
| 1798 | return { |
| 1799 | label: `event ${ev} — emit → handler (dynamic dispatch)`, |
| 1800 | compact: `dynamic: event ${ev}${at}`, |
| 1801 | registeredAt, |
| 1802 | }; |
| 1803 | } |
| 1804 | if (m?.synthesizedBy === 'react-render') { |
| 1805 | return { |
| 1806 | label: `React re-render — \`setState\` re-runs render() (dynamic dispatch)`, |
| 1807 | compact: `dynamic: React re-render via setState${at}`, |
| 1808 | registeredAt, |
| 1809 | }; |
| 1810 | } |
| 1811 | if (m?.synthesizedBy === 'jsx-render') { |
| 1812 | const child = m.via ? `<${String(m.via)}>` : 'a child component'; |
| 1813 | return { |
| 1814 | label: `renders ${child} (JSX child — dynamic dispatch)`, |
| 1815 | compact: `dynamic: renders ${child}`, |
| 1816 | registeredAt, |
| 1817 | }; |
| 1818 | } |
| 1819 | if (m?.synthesizedBy === 'vue-handler') { |
| 1820 | const ev = m.event ? `@${String(m.event)}` : 'a template event'; |
| 1821 | return { |
| 1822 | label: `Vue template handler — bound to ${ev} (dynamic dispatch)`, |
| 1823 | compact: `dynamic: Vue ${ev} handler`, |
| 1824 | registeredAt, |
| 1825 | }; |
| 1826 | } |
| 1827 | if (m?.synthesizedBy === 'interface-impl') { |
| 1828 | return { |
| 1829 | label: `interface/abstract dispatch — runs the implementation override (dynamic dispatch)`, |
| 1830 | compact: `dynamic: interface → impl${at}`, |
| 1831 | registeredAt, |
| 1832 | }; |
| 1833 | } |
| 1834 | if (m?.synthesizedBy === 'closure-collection') { |
| 1835 | const field = m.field ? `\`${String(m.field)}\`` : 'a collection'; |
| 1836 | return { |
| 1837 | label: `closure collection — runs handlers appended to ${field} (dynamic dispatch)`, |
| 1838 | compact: `dynamic: runs ${field} handlers${at}`, |
| 1839 | registeredAt, |
no outgoing calls
no test coverage detected