1{
2  "type": "Program",
3  "statements": [
4    {
5      "type": "TSTypeAliasDeclaration",
6      "id": {
7        "type": "Identifier",
8        "name": "Alias",
9        "decorators": [],
10        "loc": {
11          "start": {
12            "line": 32,
13            "column": 6
14          },
15          "end": {
16            "line": 32,
17            "column": 11
18          }
19        }
20      },
21      "typeAnnotation": {
22        "type": "ETSUnionType",
23        "types": [
24          {
25            "type": "ETSTypeReference",
26            "part": {
27              "type": "ETSTypeReferencePart",
28              "name": {
29                "type": "Identifier",
30                "name": "Promise",
31                "decorators": [],
32                "loc": {
33                  "start": {
34                    "line": 32,
35                    "column": 14
36                  },
37                  "end": {
38                    "line": 32,
39                    "column": 21
40                  }
41                }
42              },
43              "typeParams": {
44                "type": "TSTypeParameterInstantiation",
45                "params": [
46                  {
47                    "type": "ETSTypeReference",
48                    "part": {
49                      "type": "ETSTypeReferencePart",
50                      "name": {
51                        "type": "Identifier",
52                        "name": "string",
53                        "decorators": [],
54                        "loc": {
55                          "start": {
56                            "line": 32,
57                            "column": 22
58                          },
59                          "end": {
60                            "line": 32,
61                            "column": 28
62                          }
63                        }
64                      },
65                      "loc": {
66                        "start": {
67                          "line": 32,
68                          "column": 22
69                        },
70                        "end": {
71                          "line": 32,
72                          "column": 29
73                        }
74                      }
75                    },
76                    "loc": {
77                      "start": {
78                        "line": 32,
79                        "column": 22
80                      },
81                      "end": {
82                        "line": 32,
83                        "column": 29
84                      }
85                    }
86                  }
87                ],
88                "loc": {
89                  "start": {
90                    "line": 32,
91                    "column": 21
92                  },
93                  "end": {
94                    "line": 32,
95                    "column": 29
96                  }
97                }
98              },
99              "loc": {
100                "start": {
101                  "line": 32,
102                  "column": 14
103                },
104                "end": {
105                  "line": 32,
106                  "column": 30
107                }
108              }
109            },
110            "loc": {
111              "start": {
112                "line": 32,
113                "column": 14
114              },
115              "end": {
116                "line": 32,
117                "column": 30
118              }
119            }
120          },
121          {
122            "type": "ETSTypeReference",
123            "part": {
124              "type": "ETSTypeReferencePart",
125              "name": {
126                "type": "Identifier",
127                "name": "number",
128                "decorators": [],
129                "loc": {
130                  "start": {
131                    "line": 32,
132                    "column": 30
133                  },
134                  "end": {
135                    "line": 32,
136                    "column": 36
137                  }
138                }
139              },
140              "loc": {
141                "start": {
142                  "line": 32,
143                  "column": 30
144                },
145                "end": {
146                  "line": 32,
147                  "column": 37
148                }
149              }
150            },
151            "loc": {
152              "start": {
153                "line": 32,
154                "column": 30
155              },
156              "end": {
157                "line": 32,
158                "column": 37
159              }
160            }
161          }
162        ],
163        "loc": {
164          "start": {
165            "line": 32,
166            "column": 14
167          },
168          "end": {
169            "line": 32,
170            "column": 37
171          }
172        }
173      },
174      "loc": {
175        "start": {
176          "line": 32,
177          "column": 1
178        },
179        "end": {
180          "line": 32,
181          "column": 37
182        }
183      }
184    },
185    {
186      "type": "ClassDeclaration",
187      "definition": {
188        "id": {
189          "type": "Identifier",
190          "name": "ETSGLOBAL",
191          "decorators": [],
192          "loc": {
193            "start": {
194              "line": 1,
195              "column": 1
196            },
197            "end": {
198              "line": 1,
199              "column": 1
200            }
201          }
202        },
203        "superClass": null,
204        "implements": [],
205        "body": [
206          {
207            "type": "MethodDefinition",
208            "key": {
209              "type": "Identifier",
210              "name": "_$init$_",
211              "decorators": [],
212              "loc": {
213                "start": {
214                  "line": 1,
215                  "column": 1
216                },
217                "end": {
218                  "line": 1,
219                  "column": 1
220                }
221              }
222            },
223            "kind": "method",
224            "accessibility": "public",
225            "static": true,
226            "optional": false,
227            "computed": false,
228            "value": {
229              "type": "FunctionExpression",
230              "function": {
231                "type": "ScriptFunction",
232                "id": {
233                  "type": "Identifier",
234                  "name": "_$init$_",
235                  "decorators": [],
236                  "loc": {
237                    "start": {
238                      "line": 1,
239                      "column": 1
240                    },
241                    "end": {
242                      "line": 1,
243                      "column": 1
244                    }
245                  }
246                },
247                "generator": false,
248                "async": false,
249                "expression": false,
250                "params": [],
251                "body": {
252                  "type": "BlockStatement",
253                  "statements": [],
254                  "loc": {
255                    "start": {
256                      "line": 1,
257                      "column": 1
258                    },
259                    "end": {
260                      "line": 1,
261                      "column": 1
262                    }
263                  }
264                },
265                "loc": {
266                  "start": {
267                    "line": 1,
268                    "column": 1
269                  },
270                  "end": {
271                    "line": 1,
272                    "column": 1
273                  }
274                }
275              },
276              "loc": {
277                "start": {
278                  "line": 1,
279                  "column": 1
280                },
281                "end": {
282                  "line": 1,
283                  "column": 1
284                }
285              }
286            },
287            "overloads": [],
288            "decorators": [],
289            "loc": {
290              "start": {
291                "line": 1,
292                "column": 1
293              },
294              "end": {
295                "line": 1,
296                "column": 1
297              }
298            }
299          },
300          {
301            "type": "MethodDefinition",
302            "key": {
303              "type": "Identifier",
304              "name": "foo1",
305              "decorators": [],
306              "loc": {
307                "start": {
308                  "line": 16,
309                  "column": 10
310                },
311                "end": {
312                  "line": 16,
313                  "column": 14
314                }
315              }
316            },
317            "kind": "method",
318            "accessibility": "public",
319            "static": true,
320            "optional": false,
321            "computed": false,
322            "value": {
323              "type": "FunctionExpression",
324              "function": {
325                "type": "ScriptFunction",
326                "id": {
327                  "type": "Identifier",
328                  "name": "foo1",
329                  "decorators": [],
330                  "loc": {
331                    "start": {
332                      "line": 16,
333                      "column": 10
334                    },
335                    "end": {
336                      "line": 16,
337                      "column": 14
338                    }
339                  }
340                },
341                "generator": false,
342                "async": false,
343                "expression": false,
344                "params": [
345                  {
346                    "type": "ETSParameterExpression",
347                    "name": {
348                      "type": "Identifier",
349                      "name": "p",
350                      "typeAnnotation": {
351                        "type": "ETSTypeReference",
352                        "part": {
353                          "type": "ETSTypeReferencePart",
354                          "name": {
355                            "type": "Identifier",
356                            "name": "Promise",
357                            "decorators": [],
358                            "loc": {
359                              "start": {
360                                "line": 16,
361                                "column": 18
362                              },
363                              "end": {
364                                "line": 16,
365                                "column": 25
366                              }
367                            }
368                          },
369                          "typeParams": {
370                            "type": "TSTypeParameterInstantiation",
371                            "params": [
372                              {
373                                "type": "ETSTypeReference",
374                                "part": {
375                                  "type": "ETSTypeReferencePart",
376                                  "name": {
377                                    "type": "Identifier",
378                                    "name": "Promise",
379                                    "decorators": [],
380                                    "loc": {
381                                      "start": {
382                                        "line": 16,
383                                        "column": 26
384                                      },
385                                      "end": {
386                                        "line": 16,
387                                        "column": 33
388                                      }
389                                    }
390                                  },
391                                  "typeParams": {
392                                    "type": "TSTypeParameterInstantiation",
393                                    "params": [
394                                      {
395                                        "type": "ETSTypeReference",
396                                        "part": {
397                                          "type": "ETSTypeReferencePart",
398                                          "name": {
399                                            "type": "Identifier",
400                                            "name": "string",
401                                            "decorators": [],
402                                            "loc": {
403                                              "start": {
404                                                "line": 16,
405                                                "column": 34
406                                              },
407                                              "end": {
408                                                "line": 16,
409                                                "column": 40
410                                              }
411                                            }
412                                          },
413                                          "loc": {
414                                            "start": {
415                                              "line": 16,
416                                              "column": 34
417                                            },
418                                            "end": {
419                                              "line": 16,
420                                              "column": 42
421                                            }
422                                          }
423                                        },
424                                        "loc": {
425                                          "start": {
426                                            "line": 16,
427                                            "column": 34
428                                          },
429                                          "end": {
430                                            "line": 16,
431                                            "column": 42
432                                          }
433                                        }
434                                      }
435                                    ],
436                                    "loc": {
437                                      "start": {
438                                        "line": 16,
439                                        "column": 33
440                                      },
441                                      "end": {
442                                        "line": 16,
443                                        "column": 42
444                                      }
445                                    }
446                                  },
447                                  "loc": {
448                                    "start": {
449                                      "line": 16,
450                                      "column": 26
451                                    },
452                                    "end": {
453                                      "line": 16,
454                                      "column": 42
455                                    }
456                                  }
457                                },
458                                "loc": {
459                                  "start": {
460                                    "line": 16,
461                                    "column": 26
462                                  },
463                                  "end": {
464                                    "line": 16,
465                                    "column": 42
466                                  }
467                                }
468                              }
469                            ],
470                            "loc": {
471                              "start": {
472                                "line": 16,
473                                "column": 25
474                              },
475                              "end": {
476                                "line": 16,
477                                "column": 42
478                              }
479                            }
480                          },
481                          "loc": {
482                            "start": {
483                              "line": 16,
484                              "column": 18
485                            },
486                            "end": {
487                              "line": 16,
488                              "column": 43
489                            }
490                          }
491                        },
492                        "loc": {
493                          "start": {
494                            "line": 16,
495                            "column": 18
496                          },
497                          "end": {
498                            "line": 16,
499                            "column": 43
500                          }
501                        }
502                      },
503                      "decorators": [],
504                      "loc": {
505                        "start": {
506                          "line": 16,
507                          "column": 15
508                        },
509                        "end": {
510                          "line": 16,
511                          "column": 43
512                        }
513                      }
514                    },
515                    "loc": {
516                      "start": {
517                        "line": 16,
518                        "column": 15
519                      },
520                      "end": {
521                        "line": 16,
522                        "column": 43
523                      }
524                    }
525                  }
526                ],
527                "returnType": {
528                  "type": "ETSPrimitiveType",
529                  "loc": {
530                    "start": {
531                      "line": 16,
532                      "column": 45
533                    },
534                    "end": {
535                      "line": 16,
536                      "column": 49
537                    }
538                  }
539                },
540                "body": {
541                  "type": "BlockStatement",
542                  "statements": [
543                    {
544                      "type": "VariableDeclaration",
545                      "declarations": [
546                        {
547                          "type": "VariableDeclarator",
548                          "id": {
549                            "type": "Identifier",
550                            "name": "result",
551                            "typeAnnotation": {
552                              "type": "ETSTypeReference",
553                              "part": {
554                                "type": "ETSTypeReferencePart",
555                                "name": {
556                                  "type": "Identifier",
557                                  "name": "string",
558                                  "decorators": [],
559                                  "loc": {
560                                    "start": {
561                                      "line": 17,
562                                      "column": 17
563                                    },
564                                    "end": {
565                                      "line": 17,
566                                      "column": 23
567                                    }
568                                  }
569                                },
570                                "loc": {
571                                  "start": {
572                                    "line": 17,
573                                    "column": 17
574                                  },
575                                  "end": {
576                                    "line": 17,
577                                    "column": 25
578                                  }
579                                }
580                              },
581                              "loc": {
582                                "start": {
583                                  "line": 17,
584                                  "column": 17
585                                },
586                                "end": {
587                                  "line": 17,
588                                  "column": 25
589                                }
590                              }
591                            },
592                            "decorators": [],
593                            "loc": {
594                              "start": {
595                                "line": 17,
596                                "column": 9
597                              },
598                              "end": {
599                                "line": 17,
600                                "column": 15
601                              }
602                            }
603                          },
604                          "init": {
605                            "type": "AwaitExpression",
606                            "argument": {
607                              "type": "Identifier",
608                              "name": "p",
609                              "decorators": [],
610                              "loc": {
611                                "start": {
612                                  "line": 17,
613                                  "column": 32
614                                },
615                                "end": {
616                                  "line": 17,
617                                  "column": 33
618                                }
619                              }
620                            },
621                            "loc": {
622                              "start": {
623                                "line": 17,
624                                "column": 26
625                              },
626                              "end": {
627                                "line": 17,
628                                "column": 34
629                              }
630                            }
631                          },
632                          "loc": {
633                            "start": {
634                              "line": 17,
635                              "column": 9
636                            },
637                            "end": {
638                              "line": 17,
639                              "column": 34
640                            }
641                          }
642                        }
643                      ],
644                      "kind": "let",
645                      "loc": {
646                        "start": {
647                          "line": 17,
648                          "column": 5
649                        },
650                        "end": {
651                          "line": 17,
652                          "column": 34
653                        }
654                      }
655                    }
656                  ],
657                  "loc": {
658                    "start": {
659                      "line": 16,
660                      "column": 50
661                    },
662                    "end": {
663                      "line": 18,
664                      "column": 2
665                    }
666                  }
667                },
668                "loc": {
669                  "start": {
670                    "line": 16,
671                    "column": 14
672                  },
673                  "end": {
674                    "line": 18,
675                    "column": 2
676                  }
677                }
678              },
679              "loc": {
680                "start": {
681                  "line": 16,
682                  "column": 14
683                },
684                "end": {
685                  "line": 18,
686                  "column": 2
687                }
688              }
689            },
690            "overloads": [],
691            "decorators": [],
692            "loc": {
693              "start": {
694                "line": 16,
695                "column": 1
696              },
697              "end": {
698                "line": 18,
699                "column": 2
700              }
701            }
702          },
703          {
704            "type": "MethodDefinition",
705            "key": {
706              "type": "Identifier",
707              "name": "foo2",
708              "decorators": [],
709              "loc": {
710                "start": {
711                  "line": 20,
712                  "column": 10
713                },
714                "end": {
715                  "line": 20,
716                  "column": 14
717                }
718              }
719            },
720            "kind": "method",
721            "accessibility": "public",
722            "static": true,
723            "optional": false,
724            "computed": false,
725            "value": {
726              "type": "FunctionExpression",
727              "function": {
728                "type": "ScriptFunction",
729                "id": {
730                  "type": "Identifier",
731                  "name": "foo2",
732                  "decorators": [],
733                  "loc": {
734                    "start": {
735                      "line": 20,
736                      "column": 10
737                    },
738                    "end": {
739                      "line": 20,
740                      "column": 14
741                    }
742                  }
743                },
744                "generator": false,
745                "async": false,
746                "expression": false,
747                "params": [
748                  {
749                    "type": "ETSParameterExpression",
750                    "name": {
751                      "type": "Identifier",
752                      "name": "p",
753                      "typeAnnotation": {
754                        "type": "ETSTypeReference",
755                        "part": {
756                          "type": "ETSTypeReferencePart",
757                          "name": {
758                            "type": "Identifier",
759                            "name": "Promise",
760                            "decorators": [],
761                            "loc": {
762                              "start": {
763                                "line": 20,
764                                "column": 18
765                              },
766                              "end": {
767                                "line": 20,
768                                "column": 25
769                              }
770                            }
771                          },
772                          "typeParams": {
773                            "type": "TSTypeParameterInstantiation",
774                            "params": [
775                              {
776                                "type": "ETSUnionType",
777                                "types": [
778                                  {
779                                    "type": "ETSTypeReference",
780                                    "part": {
781                                      "type": "ETSTypeReferencePart",
782                                      "name": {
783                                        "type": "Identifier",
784                                        "name": "Promise",
785                                        "decorators": [],
786                                        "loc": {
787                                          "start": {
788                                            "line": 20,
789                                            "column": 26
790                                          },
791                                          "end": {
792                                            "line": 20,
793                                            "column": 33
794                                          }
795                                        }
796                                      },
797                                      "typeParams": {
798                                        "type": "TSTypeParameterInstantiation",
799                                        "params": [
800                                          {
801                                            "type": "ETSTypeReference",
802                                            "part": {
803                                              "type": "ETSTypeReferencePart",
804                                              "name": {
805                                                "type": "Identifier",
806                                                "name": "string",
807                                                "decorators": [],
808                                                "loc": {
809                                                  "start": {
810                                                    "line": 20,
811                                                    "column": 34
812                                                  },
813                                                  "end": {
814                                                    "line": 20,
815                                                    "column": 40
816                                                  }
817                                                }
818                                              },
819                                              "loc": {
820                                                "start": {
821                                                  "line": 20,
822                                                  "column": 34
823                                                },
824                                                "end": {
825                                                  "line": 20,
826                                                  "column": 41
827                                                }
828                                              }
829                                            },
830                                            "loc": {
831                                              "start": {
832                                                "line": 20,
833                                                "column": 34
834                                              },
835                                              "end": {
836                                                "line": 20,
837                                                "column": 41
838                                              }
839                                            }
840                                          }
841                                        ],
842                                        "loc": {
843                                          "start": {
844                                            "line": 20,
845                                            "column": 33
846                                          },
847                                          "end": {
848                                            "line": 20,
849                                            "column": 41
850                                          }
851                                        }
852                                      },
853                                      "loc": {
854                                        "start": {
855                                          "line": 20,
856                                          "column": 26
857                                        },
858                                        "end": {
859                                          "line": 20,
860                                          "column": 42
861                                        }
862                                      }
863                                    },
864                                    "loc": {
865                                      "start": {
866                                        "line": 20,
867                                        "column": 26
868                                      },
869                                      "end": {
870                                        "line": 20,
871                                        "column": 42
872                                      }
873                                    }
874                                  },
875                                  {
876                                    "type": "ETSTypeReference",
877                                    "part": {
878                                      "type": "ETSTypeReferencePart",
879                                      "name": {
880                                        "type": "Identifier",
881                                        "name": "number",
882                                        "decorators": [],
883                                        "loc": {
884                                          "start": {
885                                            "line": 20,
886                                            "column": 42
887                                          },
888                                          "end": {
889                                            "line": 20,
890                                            "column": 48
891                                          }
892                                        }
893                                      },
894                                      "loc": {
895                                        "start": {
896                                          "line": 20,
897                                          "column": 42
898                                        },
899                                        "end": {
900                                          "line": 20,
901                                          "column": 49
902                                        }
903                                      }
904                                    },
905                                    "loc": {
906                                      "start": {
907                                        "line": 20,
908                                        "column": 42
909                                      },
910                                      "end": {
911                                        "line": 20,
912                                        "column": 49
913                                      }
914                                    }
915                                  }
916                                ],
917                                "loc": {
918                                  "start": {
919                                    "line": 20,
920                                    "column": 26
921                                  },
922                                  "end": {
923                                    "line": 20,
924                                    "column": 49
925                                  }
926                                }
927                              }
928                            ],
929                            "loc": {
930                              "start": {
931                                "line": 20,
932                                "column": 25
933                              },
934                              "end": {
935                                "line": 20,
936                                "column": 49
937                              }
938                            }
939                          },
940                          "loc": {
941                            "start": {
942                              "line": 20,
943                              "column": 18
944                            },
945                            "end": {
946                              "line": 20,
947                              "column": 50
948                            }
949                          }
950                        },
951                        "loc": {
952                          "start": {
953                            "line": 20,
954                            "column": 18
955                          },
956                          "end": {
957                            "line": 20,
958                            "column": 50
959                          }
960                        }
961                      },
962                      "decorators": [],
963                      "loc": {
964                        "start": {
965                          "line": 20,
966                          "column": 15
967                        },
968                        "end": {
969                          "line": 20,
970                          "column": 50
971                        }
972                      }
973                    },
974                    "loc": {
975                      "start": {
976                        "line": 20,
977                        "column": 15
978                      },
979                      "end": {
980                        "line": 20,
981                        "column": 50
982                      }
983                    }
984                  }
985                ],
986                "returnType": {
987                  "type": "ETSPrimitiveType",
988                  "loc": {
989                    "start": {
990                      "line": 20,
991                      "column": 52
992                    },
993                    "end": {
994                      "line": 20,
995                      "column": 56
996                    }
997                  }
998                },
999                "body": {
1000                  "type": "BlockStatement",
1001                  "statements": [
1002                    {
1003                      "type": "VariableDeclaration",
1004                      "declarations": [
1005                        {
1006                          "type": "VariableDeclarator",
1007                          "id": {
1008                            "type": "Identifier",
1009                            "name": "result",
1010                            "typeAnnotation": {
1011                              "type": "ETSUnionType",
1012                              "types": [
1013                                {
1014                                  "type": "ETSTypeReference",
1015                                  "part": {
1016                                    "type": "ETSTypeReferencePart",
1017                                    "name": {
1018                                      "type": "Identifier",
1019                                      "name": "string",
1020                                      "decorators": [],
1021                                      "loc": {
1022                                        "start": {
1023                                          "line": 21,
1024                                          "column": 17
1025                                        },
1026                                        "end": {
1027                                          "line": 21,
1028                                          "column": 23
1029                                        }
1030                                      }
1031                                    },
1032                                    "loc": {
1033                                      "start": {
1034                                        "line": 21,
1035                                        "column": 17
1036                                      },
1037                                      "end": {
1038                                        "line": 21,
1039                                        "column": 24
1040                                      }
1041                                    }
1042                                  },
1043                                  "loc": {
1044                                    "start": {
1045                                      "line": 21,
1046                                      "column": 17
1047                                    },
1048                                    "end": {
1049                                      "line": 21,
1050                                      "column": 24
1051                                    }
1052                                  }
1053                                },
1054                                {
1055                                  "type": "ETSTypeReference",
1056                                  "part": {
1057                                    "type": "ETSTypeReferencePart",
1058                                    "name": {
1059                                      "type": "Identifier",
1060                                      "name": "number",
1061                                      "decorators": [],
1062                                      "loc": {
1063                                        "start": {
1064                                          "line": 21,
1065                                          "column": 24
1066                                        },
1067                                        "end": {
1068                                          "line": 21,
1069                                          "column": 30
1070                                        }
1071                                      }
1072                                    },
1073                                    "loc": {
1074                                      "start": {
1075                                        "line": 21,
1076                                        "column": 24
1077                                      },
1078                                      "end": {
1079                                        "line": 21,
1080                                        "column": 32
1081                                      }
1082                                    }
1083                                  },
1084                                  "loc": {
1085                                    "start": {
1086                                      "line": 21,
1087                                      "column": 24
1088                                    },
1089                                    "end": {
1090                                      "line": 21,
1091                                      "column": 32
1092                                    }
1093                                  }
1094                                }
1095                              ],
1096                              "loc": {
1097                                "start": {
1098                                  "line": 21,
1099                                  "column": 17
1100                                },
1101                                "end": {
1102                                  "line": 21,
1103                                  "column": 32
1104                                }
1105                              }
1106                            },
1107                            "decorators": [],
1108                            "loc": {
1109                              "start": {
1110                                "line": 21,
1111                                "column": 9
1112                              },
1113                              "end": {
1114                                "line": 21,
1115                                "column": 15
1116                              }
1117                            }
1118                          },
1119                          "init": {
1120                            "type": "AwaitExpression",
1121                            "argument": {
1122                              "type": "Identifier",
1123                              "name": "p",
1124                              "decorators": [],
1125                              "loc": {
1126                                "start": {
1127                                  "line": 21,
1128                                  "column": 39
1129                                },
1130                                "end": {
1131                                  "line": 21,
1132                                  "column": 40
1133                                }
1134                              }
1135                            },
1136                            "loc": {
1137                              "start": {
1138                                "line": 21,
1139                                "column": 33
1140                              },
1141                              "end": {
1142                                "line": 21,
1143                                "column": 41
1144                              }
1145                            }
1146                          },
1147                          "loc": {
1148                            "start": {
1149                              "line": 21,
1150                              "column": 9
1151                            },
1152                            "end": {
1153                              "line": 21,
1154                              "column": 41
1155                            }
1156                          }
1157                        }
1158                      ],
1159                      "kind": "let",
1160                      "loc": {
1161                        "start": {
1162                          "line": 21,
1163                          "column": 5
1164                        },
1165                        "end": {
1166                          "line": 21,
1167                          "column": 41
1168                        }
1169                      }
1170                    }
1171                  ],
1172                  "loc": {
1173                    "start": {
1174                      "line": 20,
1175                      "column": 57
1176                    },
1177                    "end": {
1178                      "line": 22,
1179                      "column": 2
1180                    }
1181                  }
1182                },
1183                "loc": {
1184                  "start": {
1185                    "line": 20,
1186                    "column": 14
1187                  },
1188                  "end": {
1189                    "line": 22,
1190                    "column": 2
1191                  }
1192                }
1193              },
1194              "loc": {
1195                "start": {
1196                  "line": 20,
1197                  "column": 14
1198                },
1199                "end": {
1200                  "line": 22,
1201                  "column": 2
1202                }
1203              }
1204            },
1205            "overloads": [],
1206            "decorators": [],
1207            "loc": {
1208              "start": {
1209                "line": 20,
1210                "column": 1
1211              },
1212              "end": {
1213                "line": 22,
1214                "column": 2
1215              }
1216            }
1217          },
1218          {
1219            "type": "MethodDefinition",
1220            "key": {
1221              "type": "Identifier",
1222              "name": "foo3",
1223              "decorators": [],
1224              "loc": {
1225                "start": {
1226                  "line": 24,
1227                  "column": 10
1228                },
1229                "end": {
1230                  "line": 24,
1231                  "column": 14
1232                }
1233              }
1234            },
1235            "kind": "method",
1236            "accessibility": "public",
1237            "static": true,
1238            "optional": false,
1239            "computed": false,
1240            "value": {
1241              "type": "FunctionExpression",
1242              "function": {
1243                "type": "ScriptFunction",
1244                "id": {
1245                  "type": "Identifier",
1246                  "name": "foo3",
1247                  "decorators": [],
1248                  "loc": {
1249                    "start": {
1250                      "line": 24,
1251                      "column": 10
1252                    },
1253                    "end": {
1254                      "line": 24,
1255                      "column": 14
1256                    }
1257                  }
1258                },
1259                "generator": false,
1260                "async": false,
1261                "expression": false,
1262                "params": [
1263                  {
1264                    "type": "ETSParameterExpression",
1265                    "name": {
1266                      "type": "Identifier",
1267                      "name": "p",
1268                      "typeAnnotation": {
1269                        "type": "ETSTypeReference",
1270                        "part": {
1271                          "type": "ETSTypeReferencePart",
1272                          "name": {
1273                            "type": "Identifier",
1274                            "name": "Promise",
1275                            "decorators": [],
1276                            "loc": {
1277                              "start": {
1278                                "line": 24,
1279                                "column": 18
1280                              },
1281                              "end": {
1282                                "line": 24,
1283                                "column": 25
1284                              }
1285                            }
1286                          },
1287                          "typeParams": {
1288                            "type": "TSTypeParameterInstantiation",
1289                            "params": [
1290                              {
1291                                "type": "ETSUnionType",
1292                                "types": [
1293                                  {
1294                                    "type": "ETSTypeReference",
1295                                    "part": {
1296                                      "type": "ETSTypeReferencePart",
1297                                      "name": {
1298                                        "type": "Identifier",
1299                                        "name": "Promise",
1300                                        "decorators": [],
1301                                        "loc": {
1302                                          "start": {
1303                                            "line": 24,
1304                                            "column": 26
1305                                          },
1306                                          "end": {
1307                                            "line": 24,
1308                                            "column": 33
1309                                          }
1310                                        }
1311                                      },
1312                                      "typeParams": {
1313                                        "type": "TSTypeParameterInstantiation",
1314                                        "params": [
1315                                          {
1316                                            "type": "ETSTypeReference",
1317                                            "part": {
1318                                              "type": "ETSTypeReferencePart",
1319                                              "name": {
1320                                                "type": "Identifier",
1321                                                "name": "string",
1322                                                "decorators": [],
1323                                                "loc": {
1324                                                  "start": {
1325                                                    "line": 24,
1326                                                    "column": 34
1327                                                  },
1328                                                  "end": {
1329                                                    "line": 24,
1330                                                    "column": 40
1331                                                  }
1332                                                }
1333                                              },
1334                                              "loc": {
1335                                                "start": {
1336                                                  "line": 24,
1337                                                  "column": 34
1338                                                },
1339                                                "end": {
1340                                                  "line": 24,
1341                                                  "column": 41
1342                                                }
1343                                              }
1344                                            },
1345                                            "loc": {
1346                                              "start": {
1347                                                "line": 24,
1348                                                "column": 34
1349                                              },
1350                                              "end": {
1351                                                "line": 24,
1352                                                "column": 41
1353                                              }
1354                                            }
1355                                          }
1356                                        ],
1357                                        "loc": {
1358                                          "start": {
1359                                            "line": 24,
1360                                            "column": 33
1361                                          },
1362                                          "end": {
1363                                            "line": 24,
1364                                            "column": 41
1365                                          }
1366                                        }
1367                                      },
1368                                      "loc": {
1369                                        "start": {
1370                                          "line": 24,
1371                                          "column": 26
1372                                        },
1373                                        "end": {
1374                                          "line": 24,
1375                                          "column": 42
1376                                        }
1377                                      }
1378                                    },
1379                                    "loc": {
1380                                      "start": {
1381                                        "line": 24,
1382                                        "column": 26
1383                                      },
1384                                      "end": {
1385                                        "line": 24,
1386                                        "column": 42
1387                                      }
1388                                    }
1389                                  },
1390                                  {
1391                                    "type": "ETSTypeReference",
1392                                    "part": {
1393                                      "type": "ETSTypeReferencePart",
1394                                      "name": {
1395                                        "type": "Identifier",
1396                                        "name": "Promise",
1397                                        "decorators": [],
1398                                        "loc": {
1399                                          "start": {
1400                                            "line": 24,
1401                                            "column": 42
1402                                          },
1403                                          "end": {
1404                                            "line": 24,
1405                                            "column": 49
1406                                          }
1407                                        }
1408                                      },
1409                                      "typeParams": {
1410                                        "type": "TSTypeParameterInstantiation",
1411                                        "params": [
1412                                          {
1413                                            "type": "ETSTypeReference",
1414                                            "part": {
1415                                              "type": "ETSTypeReferencePart",
1416                                              "name": {
1417                                                "type": "Identifier",
1418                                                "name": "number",
1419                                                "decorators": [],
1420                                                "loc": {
1421                                                  "start": {
1422                                                    "line": 24,
1423                                                    "column": 50
1424                                                  },
1425                                                  "end": {
1426                                                    "line": 24,
1427                                                    "column": 56
1428                                                  }
1429                                                }
1430                                              },
1431                                              "loc": {
1432                                                "start": {
1433                                                  "line": 24,
1434                                                  "column": 50
1435                                                },
1436                                                "end": {
1437                                                  "line": 24,
1438                                                  "column": 58
1439                                                }
1440                                              }
1441                                            },
1442                                            "loc": {
1443                                              "start": {
1444                                                "line": 24,
1445                                                "column": 50
1446                                              },
1447                                              "end": {
1448                                                "line": 24,
1449                                                "column": 58
1450                                              }
1451                                            }
1452                                          }
1453                                        ],
1454                                        "loc": {
1455                                          "start": {
1456                                            "line": 24,
1457                                            "column": 49
1458                                          },
1459                                          "end": {
1460                                            "line": 24,
1461                                            "column": 58
1462                                          }
1463                                        }
1464                                      },
1465                                      "loc": {
1466                                        "start": {
1467                                          "line": 24,
1468                                          "column": 42
1469                                        },
1470                                        "end": {
1471                                          "line": 24,
1472                                          "column": 58
1473                                        }
1474                                      }
1475                                    },
1476                                    "loc": {
1477                                      "start": {
1478                                        "line": 24,
1479                                        "column": 42
1480                                      },
1481                                      "end": {
1482                                        "line": 24,
1483                                        "column": 58
1484                                      }
1485                                    }
1486                                  }
1487                                ],
1488                                "loc": {
1489                                  "start": {
1490                                    "line": 24,
1491                                    "column": 26
1492                                  },
1493                                  "end": {
1494                                    "line": 24,
1495                                    "column": 58
1496                                  }
1497                                }
1498                              }
1499                            ],
1500                            "loc": {
1501                              "start": {
1502                                "line": 24,
1503                                "column": 25
1504                              },
1505                              "end": {
1506                                "line": 24,
1507                                "column": 58
1508                              }
1509                            }
1510                          },
1511                          "loc": {
1512                            "start": {
1513                              "line": 24,
1514                              "column": 18
1515                            },
1516                            "end": {
1517                              "line": 24,
1518                              "column": 59
1519                            }
1520                          }
1521                        },
1522                        "loc": {
1523                          "start": {
1524                            "line": 24,
1525                            "column": 18
1526                          },
1527                          "end": {
1528                            "line": 24,
1529                            "column": 59
1530                          }
1531                        }
1532                      },
1533                      "decorators": [],
1534                      "loc": {
1535                        "start": {
1536                          "line": 24,
1537                          "column": 15
1538                        },
1539                        "end": {
1540                          "line": 24,
1541                          "column": 59
1542                        }
1543                      }
1544                    },
1545                    "loc": {
1546                      "start": {
1547                        "line": 24,
1548                        "column": 15
1549                      },
1550                      "end": {
1551                        "line": 24,
1552                        "column": 59
1553                      }
1554                    }
1555                  }
1556                ],
1557                "returnType": {
1558                  "type": "ETSPrimitiveType",
1559                  "loc": {
1560                    "start": {
1561                      "line": 24,
1562                      "column": 61
1563                    },
1564                    "end": {
1565                      "line": 24,
1566                      "column": 65
1567                    }
1568                  }
1569                },
1570                "body": {
1571                  "type": "BlockStatement",
1572                  "statements": [
1573                    {
1574                      "type": "VariableDeclaration",
1575                      "declarations": [
1576                        {
1577                          "type": "VariableDeclarator",
1578                          "id": {
1579                            "type": "Identifier",
1580                            "name": "result",
1581                            "typeAnnotation": {
1582                              "type": "ETSUnionType",
1583                              "types": [
1584                                {
1585                                  "type": "ETSTypeReference",
1586                                  "part": {
1587                                    "type": "ETSTypeReferencePart",
1588                                    "name": {
1589                                      "type": "Identifier",
1590                                      "name": "string",
1591                                      "decorators": [],
1592                                      "loc": {
1593                                        "start": {
1594                                          "line": 25,
1595                                          "column": 17
1596                                        },
1597                                        "end": {
1598                                          "line": 25,
1599                                          "column": 23
1600                                        }
1601                                      }
1602                                    },
1603                                    "loc": {
1604                                      "start": {
1605                                        "line": 25,
1606                                        "column": 17
1607                                      },
1608                                      "end": {
1609                                        "line": 25,
1610                                        "column": 24
1611                                      }
1612                                    }
1613                                  },
1614                                  "loc": {
1615                                    "start": {
1616                                      "line": 25,
1617                                      "column": 17
1618                                    },
1619                                    "end": {
1620                                      "line": 25,
1621                                      "column": 24
1622                                    }
1623                                  }
1624                                },
1625                                {
1626                                  "type": "ETSTypeReference",
1627                                  "part": {
1628                                    "type": "ETSTypeReferencePart",
1629                                    "name": {
1630                                      "type": "Identifier",
1631                                      "name": "number",
1632                                      "decorators": [],
1633                                      "loc": {
1634                                        "start": {
1635                                          "line": 25,
1636                                          "column": 24
1637                                        },
1638                                        "end": {
1639                                          "line": 25,
1640                                          "column": 30
1641                                        }
1642                                      }
1643                                    },
1644                                    "loc": {
1645                                      "start": {
1646                                        "line": 25,
1647                                        "column": 24
1648                                      },
1649                                      "end": {
1650                                        "line": 25,
1651                                        "column": 32
1652                                      }
1653                                    }
1654                                  },
1655                                  "loc": {
1656                                    "start": {
1657                                      "line": 25,
1658                                      "column": 24
1659                                    },
1660                                    "end": {
1661                                      "line": 25,
1662                                      "column": 32
1663                                    }
1664                                  }
1665                                }
1666                              ],
1667                              "loc": {
1668                                "start": {
1669                                  "line": 25,
1670                                  "column": 17
1671                                },
1672                                "end": {
1673                                  "line": 25,
1674                                  "column": 32
1675                                }
1676                              }
1677                            },
1678                            "decorators": [],
1679                            "loc": {
1680                              "start": {
1681                                "line": 25,
1682                                "column": 9
1683                              },
1684                              "end": {
1685                                "line": 25,
1686                                "column": 15
1687                              }
1688                            }
1689                          },
1690                          "init": {
1691                            "type": "AwaitExpression",
1692                            "argument": {
1693                              "type": "Identifier",
1694                              "name": "p",
1695                              "decorators": [],
1696                              "loc": {
1697                                "start": {
1698                                  "line": 25,
1699                                  "column": 39
1700                                },
1701                                "end": {
1702                                  "line": 25,
1703                                  "column": 40
1704                                }
1705                              }
1706                            },
1707                            "loc": {
1708                              "start": {
1709                                "line": 25,
1710                                "column": 33
1711                              },
1712                              "end": {
1713                                "line": 25,
1714                                "column": 41
1715                              }
1716                            }
1717                          },
1718                          "loc": {
1719                            "start": {
1720                              "line": 25,
1721                              "column": 9
1722                            },
1723                            "end": {
1724                              "line": 25,
1725                              "column": 41
1726                            }
1727                          }
1728                        }
1729                      ],
1730                      "kind": "let",
1731                      "loc": {
1732                        "start": {
1733                          "line": 25,
1734                          "column": 5
1735                        },
1736                        "end": {
1737                          "line": 25,
1738                          "column": 41
1739                        }
1740                      }
1741                    }
1742                  ],
1743                  "loc": {
1744                    "start": {
1745                      "line": 24,
1746                      "column": 66
1747                    },
1748                    "end": {
1749                      "line": 26,
1750                      "column": 2
1751                    }
1752                  }
1753                },
1754                "loc": {
1755                  "start": {
1756                    "line": 24,
1757                    "column": 14
1758                  },
1759                  "end": {
1760                    "line": 26,
1761                    "column": 2
1762                  }
1763                }
1764              },
1765              "loc": {
1766                "start": {
1767                  "line": 24,
1768                  "column": 14
1769                },
1770                "end": {
1771                  "line": 26,
1772                  "column": 2
1773                }
1774              }
1775            },
1776            "overloads": [],
1777            "decorators": [],
1778            "loc": {
1779              "start": {
1780                "line": 24,
1781                "column": 1
1782              },
1783              "end": {
1784                "line": 26,
1785                "column": 2
1786              }
1787            }
1788          },
1789          {
1790            "type": "MethodDefinition",
1791            "key": {
1792              "type": "Identifier",
1793              "name": "foo4",
1794              "decorators": [],
1795              "loc": {
1796                "start": {
1797                  "line": 28,
1798                  "column": 10
1799                },
1800                "end": {
1801                  "line": 28,
1802                  "column": 14
1803                }
1804              }
1805            },
1806            "kind": "method",
1807            "accessibility": "public",
1808            "static": true,
1809            "optional": false,
1810            "computed": false,
1811            "value": {
1812              "type": "FunctionExpression",
1813              "function": {
1814                "type": "ScriptFunction",
1815                "id": {
1816                  "type": "Identifier",
1817                  "name": "foo4",
1818                  "decorators": [],
1819                  "loc": {
1820                    "start": {
1821                      "line": 28,
1822                      "column": 10
1823                    },
1824                    "end": {
1825                      "line": 28,
1826                      "column": 14
1827                    }
1828                  }
1829                },
1830                "generator": false,
1831                "async": false,
1832                "expression": false,
1833                "params": [
1834                  {
1835                    "type": "ETSParameterExpression",
1836                    "name": {
1837                      "type": "Identifier",
1838                      "name": "p",
1839                      "typeAnnotation": {
1840                        "type": "ETSTypeReference",
1841                        "part": {
1842                          "type": "ETSTypeReferencePart",
1843                          "name": {
1844                            "type": "Identifier",
1845                            "name": "Promise",
1846                            "decorators": [],
1847                            "loc": {
1848                              "start": {
1849                                "line": 28,
1850                                "column": 18
1851                              },
1852                              "end": {
1853                                "line": 28,
1854                                "column": 25
1855                              }
1856                            }
1857                          },
1858                          "typeParams": {
1859                            "type": "TSTypeParameterInstantiation",
1860                            "params": [
1861                              {
1862                                "type": "ETSUnionType",
1863                                "types": [
1864                                  {
1865                                    "type": "ETSNullType",
1866                                    "loc": {
1867                                      "start": {
1868                                        "line": 28,
1869                                        "column": 26
1870                                      },
1871                                      "end": {
1872                                        "line": 28,
1873                                        "column": 30
1874                                      }
1875                                    }
1876                                  },
1877                                  {
1878                                    "type": "ETSTypeReference",
1879                                    "part": {
1880                                      "type": "ETSTypeReferencePart",
1881                                      "name": {
1882                                        "type": "Identifier",
1883                                        "name": "Promise",
1884                                        "decorators": [],
1885                                        "loc": {
1886                                          "start": {
1887                                            "line": 28,
1888                                            "column": 31
1889                                          },
1890                                          "end": {
1891                                            "line": 28,
1892                                            "column": 38
1893                                          }
1894                                        }
1895                                      },
1896                                      "typeParams": {
1897                                        "type": "TSTypeParameterInstantiation",
1898                                        "params": [
1899                                          {
1900                                            "type": "ETSTypeReference",
1901                                            "part": {
1902                                              "type": "ETSTypeReferencePart",
1903                                              "name": {
1904                                                "type": "Identifier",
1905                                                "name": "string",
1906                                                "decorators": [],
1907                                                "loc": {
1908                                                  "start": {
1909                                                    "line": 28,
1910                                                    "column": 39
1911                                                  },
1912                                                  "end": {
1913                                                    "line": 28,
1914                                                    "column": 45
1915                                                  }
1916                                                }
1917                                              },
1918                                              "loc": {
1919                                                "start": {
1920                                                  "line": 28,
1921                                                  "column": 39
1922                                                },
1923                                                "end": {
1924                                                  "line": 28,
1925                                                  "column": 47
1926                                                }
1927                                              }
1928                                            },
1929                                            "loc": {
1930                                              "start": {
1931                                                "line": 28,
1932                                                "column": 39
1933                                              },
1934                                              "end": {
1935                                                "line": 28,
1936                                                "column": 47
1937                                              }
1938                                            }
1939                                          }
1940                                        ],
1941                                        "loc": {
1942                                          "start": {
1943                                            "line": 28,
1944                                            "column": 38
1945                                          },
1946                                          "end": {
1947                                            "line": 28,
1948                                            "column": 47
1949                                          }
1950                                        }
1951                                      },
1952                                      "loc": {
1953                                        "start": {
1954                                          "line": 28,
1955                                          "column": 31
1956                                        },
1957                                        "end": {
1958                                          "line": 28,
1959                                          "column": 47
1960                                        }
1961                                      }
1962                                    },
1963                                    "loc": {
1964                                      "start": {
1965                                        "line": 28,
1966                                        "column": 31
1967                                      },
1968                                      "end": {
1969                                        "line": 28,
1970                                        "column": 47
1971                                      }
1972                                    }
1973                                  }
1974                                ],
1975                                "loc": {
1976                                  "start": {
1977                                    "line": 28,
1978                                    "column": 26
1979                                  },
1980                                  "end": {
1981                                    "line": 28,
1982                                    "column": 47
1983                                  }
1984                                }
1985                              }
1986                            ],
1987                            "loc": {
1988                              "start": {
1989                                "line": 28,
1990                                "column": 25
1991                              },
1992                              "end": {
1993                                "line": 28,
1994                                "column": 47
1995                              }
1996                            }
1997                          },
1998                          "loc": {
1999                            "start": {
2000                              "line": 28,
2001                              "column": 18
2002                            },
2003                            "end": {
2004                              "line": 28,
2005                              "column": 48
2006                            }
2007                          }
2008                        },
2009                        "loc": {
2010                          "start": {
2011                            "line": 28,
2012                            "column": 18
2013                          },
2014                          "end": {
2015                            "line": 28,
2016                            "column": 48
2017                          }
2018                        }
2019                      },
2020                      "decorators": [],
2021                      "loc": {
2022                        "start": {
2023                          "line": 28,
2024                          "column": 15
2025                        },
2026                        "end": {
2027                          "line": 28,
2028                          "column": 48
2029                        }
2030                      }
2031                    },
2032                    "loc": {
2033                      "start": {
2034                        "line": 28,
2035                        "column": 15
2036                      },
2037                      "end": {
2038                        "line": 28,
2039                        "column": 48
2040                      }
2041                    }
2042                  }
2043                ],
2044                "returnType": {
2045                  "type": "ETSPrimitiveType",
2046                  "loc": {
2047                    "start": {
2048                      "line": 28,
2049                      "column": 50
2050                    },
2051                    "end": {
2052                      "line": 28,
2053                      "column": 54
2054                    }
2055                  }
2056                },
2057                "body": {
2058                  "type": "BlockStatement",
2059                  "statements": [
2060                    {
2061                      "type": "VariableDeclaration",
2062                      "declarations": [
2063                        {
2064                          "type": "VariableDeclarator",
2065                          "id": {
2066                            "type": "Identifier",
2067                            "name": "result",
2068                            "typeAnnotation": {
2069                              "type": "ETSUnionType",
2070                              "types": [
2071                                {
2072                                  "type": "ETSNullType",
2073                                  "loc": {
2074                                    "start": {
2075                                      "line": 29,
2076                                      "column": 17
2077                                    },
2078                                    "end": {
2079                                      "line": 29,
2080                                      "column": 21
2081                                    }
2082                                  }
2083                                },
2084                                {
2085                                  "type": "ETSTypeReference",
2086                                  "part": {
2087                                    "type": "ETSTypeReferencePart",
2088                                    "name": {
2089                                      "type": "Identifier",
2090                                      "name": "string",
2091                                      "decorators": [],
2092                                      "loc": {
2093                                        "start": {
2094                                          "line": 29,
2095                                          "column": 22
2096                                        },
2097                                        "end": {
2098                                          "line": 29,
2099                                          "column": 28
2100                                        }
2101                                      }
2102                                    },
2103                                    "loc": {
2104                                      "start": {
2105                                        "line": 29,
2106                                        "column": 22
2107                                      },
2108                                      "end": {
2109                                        "line": 29,
2110                                        "column": 30
2111                                      }
2112                                    }
2113                                  },
2114                                  "loc": {
2115                                    "start": {
2116                                      "line": 29,
2117                                      "column": 22
2118                                    },
2119                                    "end": {
2120                                      "line": 29,
2121                                      "column": 30
2122                                    }
2123                                  }
2124                                }
2125                              ],
2126                              "loc": {
2127                                "start": {
2128                                  "line": 29,
2129                                  "column": 17
2130                                },
2131                                "end": {
2132                                  "line": 29,
2133                                  "column": 30
2134                                }
2135                              }
2136                            },
2137                            "decorators": [],
2138                            "loc": {
2139                              "start": {
2140                                "line": 29,
2141                                "column": 9
2142                              },
2143                              "end": {
2144                                "line": 29,
2145                                "column": 15
2146                              }
2147                            }
2148                          },
2149                          "init": {
2150                            "type": "AwaitExpression",
2151                            "argument": {
2152                              "type": "Identifier",
2153                              "name": "p",
2154                              "decorators": [],
2155                              "loc": {
2156                                "start": {
2157                                  "line": 29,
2158                                  "column": 37
2159                                },
2160                                "end": {
2161                                  "line": 29,
2162                                  "column": 38
2163                                }
2164                              }
2165                            },
2166                            "loc": {
2167                              "start": {
2168                                "line": 29,
2169                                "column": 31
2170                              },
2171                              "end": {
2172                                "line": 29,
2173                                "column": 39
2174                              }
2175                            }
2176                          },
2177                          "loc": {
2178                            "start": {
2179                              "line": 29,
2180                              "column": 9
2181                            },
2182                            "end": {
2183                              "line": 29,
2184                              "column": 39
2185                            }
2186                          }
2187                        }
2188                      ],
2189                      "kind": "let",
2190                      "loc": {
2191                        "start": {
2192                          "line": 29,
2193                          "column": 5
2194                        },
2195                        "end": {
2196                          "line": 29,
2197                          "column": 39
2198                        }
2199                      }
2200                    }
2201                  ],
2202                  "loc": {
2203                    "start": {
2204                      "line": 28,
2205                      "column": 55
2206                    },
2207                    "end": {
2208                      "line": 30,
2209                      "column": 2
2210                    }
2211                  }
2212                },
2213                "loc": {
2214                  "start": {
2215                    "line": 28,
2216                    "column": 14
2217                  },
2218                  "end": {
2219                    "line": 30,
2220                    "column": 2
2221                  }
2222                }
2223              },
2224              "loc": {
2225                "start": {
2226                  "line": 28,
2227                  "column": 14
2228                },
2229                "end": {
2230                  "line": 30,
2231                  "column": 2
2232                }
2233              }
2234            },
2235            "overloads": [],
2236            "decorators": [],
2237            "loc": {
2238              "start": {
2239                "line": 28,
2240                "column": 1
2241              },
2242              "end": {
2243                "line": 30,
2244                "column": 2
2245              }
2246            }
2247          },
2248          {
2249            "type": "MethodDefinition",
2250            "key": {
2251              "type": "Identifier",
2252              "name": "foo5",
2253              "decorators": [],
2254              "loc": {
2255                "start": {
2256                  "line": 33,
2257                  "column": 10
2258                },
2259                "end": {
2260                  "line": 33,
2261                  "column": 14
2262                }
2263              }
2264            },
2265            "kind": "method",
2266            "accessibility": "public",
2267            "static": true,
2268            "optional": false,
2269            "computed": false,
2270            "value": {
2271              "type": "FunctionExpression",
2272              "function": {
2273                "type": "ScriptFunction",
2274                "id": {
2275                  "type": "Identifier",
2276                  "name": "foo5",
2277                  "decorators": [],
2278                  "loc": {
2279                    "start": {
2280                      "line": 33,
2281                      "column": 10
2282                    },
2283                    "end": {
2284                      "line": 33,
2285                      "column": 14
2286                    }
2287                  }
2288                },
2289                "generator": false,
2290                "async": false,
2291                "expression": false,
2292                "params": [
2293                  {
2294                    "type": "ETSParameterExpression",
2295                    "name": {
2296                      "type": "Identifier",
2297                      "name": "p",
2298                      "typeAnnotation": {
2299                        "type": "ETSTypeReference",
2300                        "part": {
2301                          "type": "ETSTypeReferencePart",
2302                          "name": {
2303                            "type": "Identifier",
2304                            "name": "Promise",
2305                            "decorators": [],
2306                            "loc": {
2307                              "start": {
2308                                "line": 33,
2309                                "column": 18
2310                              },
2311                              "end": {
2312                                "line": 33,
2313                                "column": 25
2314                              }
2315                            }
2316                          },
2317                          "typeParams": {
2318                            "type": "TSTypeParameterInstantiation",
2319                            "params": [
2320                              {
2321                                "type": "ETSTypeReference",
2322                                "part": {
2323                                  "type": "ETSTypeReferencePart",
2324                                  "name": {
2325                                    "type": "Identifier",
2326                                    "name": "Alias",
2327                                    "decorators": [],
2328                                    "loc": {
2329                                      "start": {
2330                                        "line": 33,
2331                                        "column": 26
2332                                      },
2333                                      "end": {
2334                                        "line": 33,
2335                                        "column": 31
2336                                      }
2337                                    }
2338                                  },
2339                                  "loc": {
2340                                    "start": {
2341                                      "line": 33,
2342                                      "column": 26
2343                                    },
2344                                    "end": {
2345                                      "line": 33,
2346                                      "column": 32
2347                                    }
2348                                  }
2349                                },
2350                                "loc": {
2351                                  "start": {
2352                                    "line": 33,
2353                                    "column": 26
2354                                  },
2355                                  "end": {
2356                                    "line": 33,
2357                                    "column": 32
2358                                  }
2359                                }
2360                              }
2361                            ],
2362                            "loc": {
2363                              "start": {
2364                                "line": 33,
2365                                "column": 25
2366                              },
2367                              "end": {
2368                                "line": 33,
2369                                "column": 32
2370                              }
2371                            }
2372                          },
2373                          "loc": {
2374                            "start": {
2375                              "line": 33,
2376                              "column": 18
2377                            },
2378                            "end": {
2379                              "line": 33,
2380                              "column": 33
2381                            }
2382                          }
2383                        },
2384                        "loc": {
2385                          "start": {
2386                            "line": 33,
2387                            "column": 18
2388                          },
2389                          "end": {
2390                            "line": 33,
2391                            "column": 33
2392                          }
2393                        }
2394                      },
2395                      "decorators": [],
2396                      "loc": {
2397                        "start": {
2398                          "line": 33,
2399                          "column": 15
2400                        },
2401                        "end": {
2402                          "line": 33,
2403                          "column": 33
2404                        }
2405                      }
2406                    },
2407                    "loc": {
2408                      "start": {
2409                        "line": 33,
2410                        "column": 15
2411                      },
2412                      "end": {
2413                        "line": 33,
2414                        "column": 33
2415                      }
2416                    }
2417                  }
2418                ],
2419                "returnType": {
2420                  "type": "ETSPrimitiveType",
2421                  "loc": {
2422                    "start": {
2423                      "line": 33,
2424                      "column": 35
2425                    },
2426                    "end": {
2427                      "line": 33,
2428                      "column": 39
2429                    }
2430                  }
2431                },
2432                "body": {
2433                  "type": "BlockStatement",
2434                  "statements": [
2435                    {
2436                      "type": "VariableDeclaration",
2437                      "declarations": [
2438                        {
2439                          "type": "VariableDeclarator",
2440                          "id": {
2441                            "type": "Identifier",
2442                            "name": "result",
2443                            "typeAnnotation": {
2444                              "type": "ETSUnionType",
2445                              "types": [
2446                                {
2447                                  "type": "ETSTypeReference",
2448                                  "part": {
2449                                    "type": "ETSTypeReferencePart",
2450                                    "name": {
2451                                      "type": "Identifier",
2452                                      "name": "string",
2453                                      "decorators": [],
2454                                      "loc": {
2455                                        "start": {
2456                                          "line": 34,
2457                                          "column": 17
2458                                        },
2459                                        "end": {
2460                                          "line": 34,
2461                                          "column": 23
2462                                        }
2463                                      }
2464                                    },
2465                                    "loc": {
2466                                      "start": {
2467                                        "line": 34,
2468                                        "column": 17
2469                                      },
2470                                      "end": {
2471                                        "line": 34,
2472                                        "column": 24
2473                                      }
2474                                    }
2475                                  },
2476                                  "loc": {
2477                                    "start": {
2478                                      "line": 34,
2479                                      "column": 17
2480                                    },
2481                                    "end": {
2482                                      "line": 34,
2483                                      "column": 24
2484                                    }
2485                                  }
2486                                },
2487                                {
2488                                  "type": "ETSTypeReference",
2489                                  "part": {
2490                                    "type": "ETSTypeReferencePart",
2491                                    "name": {
2492                                      "type": "Identifier",
2493                                      "name": "number",
2494                                      "decorators": [],
2495                                      "loc": {
2496                                        "start": {
2497                                          "line": 34,
2498                                          "column": 24
2499                                        },
2500                                        "end": {
2501                                          "line": 34,
2502                                          "column": 30
2503                                        }
2504                                      }
2505                                    },
2506                                    "loc": {
2507                                      "start": {
2508                                        "line": 34,
2509                                        "column": 24
2510                                      },
2511                                      "end": {
2512                                        "line": 34,
2513                                        "column": 32
2514                                      }
2515                                    }
2516                                  },
2517                                  "loc": {
2518                                    "start": {
2519                                      "line": 34,
2520                                      "column": 24
2521                                    },
2522                                    "end": {
2523                                      "line": 34,
2524                                      "column": 32
2525                                    }
2526                                  }
2527                                }
2528                              ],
2529                              "loc": {
2530                                "start": {
2531                                  "line": 34,
2532                                  "column": 17
2533                                },
2534                                "end": {
2535                                  "line": 34,
2536                                  "column": 32
2537                                }
2538                              }
2539                            },
2540                            "decorators": [],
2541                            "loc": {
2542                              "start": {
2543                                "line": 34,
2544                                "column": 9
2545                              },
2546                              "end": {
2547                                "line": 34,
2548                                "column": 15
2549                              }
2550                            }
2551                          },
2552                          "init": {
2553                            "type": "AwaitExpression",
2554                            "argument": {
2555                              "type": "Identifier",
2556                              "name": "p",
2557                              "decorators": [],
2558                              "loc": {
2559                                "start": {
2560                                  "line": 34,
2561                                  "column": 39
2562                                },
2563                                "end": {
2564                                  "line": 34,
2565                                  "column": 40
2566                                }
2567                              }
2568                            },
2569                            "loc": {
2570                              "start": {
2571                                "line": 34,
2572                                "column": 33
2573                              },
2574                              "end": {
2575                                "line": 34,
2576                                "column": 41
2577                              }
2578                            }
2579                          },
2580                          "loc": {
2581                            "start": {
2582                              "line": 34,
2583                              "column": 9
2584                            },
2585                            "end": {
2586                              "line": 34,
2587                              "column": 41
2588                            }
2589                          }
2590                        }
2591                      ],
2592                      "kind": "let",
2593                      "loc": {
2594                        "start": {
2595                          "line": 34,
2596                          "column": 5
2597                        },
2598                        "end": {
2599                          "line": 34,
2600                          "column": 41
2601                        }
2602                      }
2603                    }
2604                  ],
2605                  "loc": {
2606                    "start": {
2607                      "line": 33,
2608                      "column": 40
2609                    },
2610                    "end": {
2611                      "line": 35,
2612                      "column": 2
2613                    }
2614                  }
2615                },
2616                "loc": {
2617                  "start": {
2618                    "line": 33,
2619                    "column": 14
2620                  },
2621                  "end": {
2622                    "line": 35,
2623                    "column": 2
2624                  }
2625                }
2626              },
2627              "loc": {
2628                "start": {
2629                  "line": 33,
2630                  "column": 14
2631                },
2632                "end": {
2633                  "line": 35,
2634                  "column": 2
2635                }
2636              }
2637            },
2638            "overloads": [],
2639            "decorators": [],
2640            "loc": {
2641              "start": {
2642                "line": 33,
2643                "column": 1
2644              },
2645              "end": {
2646                "line": 35,
2647                "column": 2
2648              }
2649            }
2650          }
2651        ],
2652        "loc": {
2653          "start": {
2654            "line": 1,
2655            "column": 1
2656          },
2657          "end": {
2658            "line": 1,
2659            "column": 1
2660          }
2661        }
2662      },
2663      "loc": {
2664        "start": {
2665          "line": 1,
2666          "column": 1
2667        },
2668        "end": {
2669          "line": 1,
2670          "column": 1
2671        }
2672      }
2673    }
2674  ],
2675  "loc": {
2676    "start": {
2677      "line": 1,
2678      "column": 1
2679    },
2680    "end": {
2681      "line": 36,
2682      "column": 1
2683    }
2684  }
2685}
2686