(g: BranchGuard)
| 358 | } |
| 359 | |
| 360 | function formOf(g: BranchGuard): 'if' | 'switch' | 'ternary' | 'try' { |
| 361 | switch (g.form) { |
| 362 | case 'case': |
| 363 | return 'switch'; |
| 364 | case 'ternary': |
| 365 | return 'ternary'; |
| 366 | case 'catch': |
| 367 | return 'try'; |
| 368 | default: |
| 369 | return 'if'; |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | /** |
| 374 | * How each arm ends, decided after its body is known: an arm whose last item |