(cg: CodeGraph, cls: Node)
| 280 | } |
| 281 | |
| 282 | function handlerMethodOf(cg: CodeGraph, cls: Node): Node | null { |
| 283 | try { |
| 284 | return ( |
| 285 | cg |
| 286 | .getOutgoingEdges(cls.id) |
| 287 | .filter((e) => e.kind === 'contains') |
| 288 | .map((e) => { |
| 289 | try { |
| 290 | return cg.getNode(e.target); |
| 291 | } catch { |
| 292 | return null; |
| 293 | } |
| 294 | }) |
| 295 | .find((c): c is Node => !!c && c.kind === 'method' && HANDLER_METHODS.test(c.name)) ?? null |
| 296 | ); |
| 297 | } catch { |
| 298 | return null; // a class whose members do not resolve — show the class itself |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | // ============================================================================= |
| 303 | // Continuations |
no test coverage detected