• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "type": "Program",
3  "statements": [
4    {
5      "type": "ClassDeclaration",
6      "definition": {
7        "id": {
8          "type": "Identifier",
9          "name": "ETSGLOBAL",
10          "decorators": [],
11          "loc": {
12            "start": {
13              "line": 1,
14              "column": 1,
15              "program": "FunctionInSwitch.ets"
16            },
17            "end": {
18              "line": 1,
19              "column": 1,
20              "program": "FunctionInSwitch.ets"
21            }
22          }
23        },
24        "superClass": null,
25        "implements": [],
26        "body": [
27          {
28            "type": "MethodDefinition",
29            "key": {
30              "type": "Identifier",
31              "name": "_$init$_",
32              "decorators": [],
33              "loc": {
34                "start": {
35                  "line": 1,
36                  "column": 1,
37                  "program": null
38                },
39                "end": {
40                  "line": 1,
41                  "column": 1,
42                  "program": null
43                }
44              }
45            },
46            "kind": "method",
47            "accessibility": "public",
48            "static": true,
49            "optional": false,
50            "computed": false,
51            "value": {
52              "type": "FunctionExpression",
53              "function": {
54                "type": "ScriptFunction",
55                "id": {
56                  "type": "Identifier",
57                  "name": "_$init$_",
58                  "decorators": [],
59                  "loc": {
60                    "start": {
61                      "line": 1,
62                      "column": 1,
63                      "program": null
64                    },
65                    "end": {
66                      "line": 1,
67                      "column": 1,
68                      "program": null
69                    }
70                  }
71                },
72                "generator": false,
73                "async": false,
74                "expression": false,
75                "params": [],
76                "body": {
77                  "type": "BlockStatement",
78                  "statements": [],
79                  "loc": {
80                    "start": {
81                      "line": 1,
82                      "column": 1,
83                      "program": null
84                    },
85                    "end": {
86                      "line": 1,
87                      "column": 1,
88                      "program": null
89                    }
90                  }
91                },
92                "loc": {
93                  "start": {
94                    "line": 1,
95                    "column": 1,
96                    "program": null
97                  },
98                  "end": {
99                    "line": 1,
100                    "column": 1,
101                    "program": null
102                  }
103                }
104              },
105              "loc": {
106                "start": {
107                  "line": 1,
108                  "column": 1,
109                  "program": null
110                },
111                "end": {
112                  "line": 1,
113                  "column": 1,
114                  "program": null
115                }
116              }
117            },
118            "overloads": [],
119            "decorators": [],
120            "loc": {
121              "start": {
122                "line": 1,
123                "column": 1,
124                "program": "FunctionInSwitch.ets"
125              },
126              "end": {
127                "line": 1,
128                "column": 1,
129                "program": "FunctionInSwitch.ets"
130              }
131            }
132          },
133          {
134            "type": "MethodDefinition",
135            "key": {
136              "type": "Identifier",
137              "name": "is_active",
138              "decorators": [],
139              "loc": {
140                "start": {
141                  "line": 16,
142                  "column": 10,
143                  "program": "FunctionInSwitch.ets"
144                },
145                "end": {
146                  "line": 16,
147                  "column": 19,
148                  "program": "FunctionInSwitch.ets"
149                }
150              }
151            },
152            "kind": "method",
153            "accessibility": "public",
154            "static": true,
155            "optional": false,
156            "computed": false,
157            "value": {
158              "type": "FunctionExpression",
159              "function": {
160                "type": "ScriptFunction",
161                "id": {
162                  "type": "Identifier",
163                  "name": "is_active",
164                  "decorators": [],
165                  "loc": {
166                    "start": {
167                      "line": 16,
168                      "column": 10,
169                      "program": "FunctionInSwitch.ets"
170                    },
171                    "end": {
172                      "line": 16,
173                      "column": 19,
174                      "program": "FunctionInSwitch.ets"
175                    }
176                  }
177                },
178                "generator": false,
179                "async": false,
180                "expression": false,
181                "params": [
182                  {
183                    "type": "ETSParameterExpression",
184                    "name": {
185                      "type": "Identifier",
186                      "name": "fn",
187                      "typeAnnotation": {
188                        "type": "ETSFunctionType",
189                        "params": [],
190                        "returnType": {
191                          "type": "ETSPrimitiveType",
192                          "loc": {
193                            "start": {
194                              "line": 16,
195                              "column": 30,
196                              "program": "FunctionInSwitch.ets"
197                            },
198                            "end": {
199                              "line": 16,
200                              "column": 33,
201                              "program": "FunctionInSwitch.ets"
202                            }
203                          }
204                        },
205                        "loc": {
206                          "start": {
207                            "line": 16,
208                            "column": 24,
209                            "program": "FunctionInSwitch.ets"
210                          },
211                          "end": {
212                            "line": 16,
213                            "column": 33,
214                            "program": "FunctionInSwitch.ets"
215                          }
216                        }
217                      },
218                      "decorators": [],
219                      "loc": {
220                        "start": {
221                          "line": 16,
222                          "column": 20,
223                          "program": "FunctionInSwitch.ets"
224                        },
225                        "end": {
226                          "line": 16,
227                          "column": 33,
228                          "program": "FunctionInSwitch.ets"
229                        }
230                      }
231                    },
232                    "loc": {
233                      "start": {
234                        "line": 16,
235                        "column": 20,
236                        "program": "FunctionInSwitch.ets"
237                      },
238                      "end": {
239                        "line": 16,
240                        "column": 33,
241                        "program": "FunctionInSwitch.ets"
242                      }
243                    }
244                  }
245                ],
246                "returnType": {
247                  "type": "ETSPrimitiveType",
248                  "loc": {
249                    "start": {
250                      "line": 16,
251                      "column": 36,
252                      "program": "FunctionInSwitch.ets"
253                    },
254                    "end": {
255                      "line": 16,
256                      "column": 39,
257                      "program": "FunctionInSwitch.ets"
258                    }
259                  }
260                },
261                "body": {
262                  "type": "BlockStatement",
263                  "statements": [
264                    {
265                      "type": "ReturnStatement",
266                      "argument": {
267                        "type": "CallExpression",
268                        "callee": {
269                          "type": "Identifier",
270                          "name": "fn",
271                          "decorators": [],
272                          "loc": {
273                            "start": {
274                              "line": 17,
275                              "column": 12,
276                              "program": "FunctionInSwitch.ets"
277                            },
278                            "end": {
279                              "line": 17,
280                              "column": 14,
281                              "program": "FunctionInSwitch.ets"
282                            }
283                          }
284                        },
285                        "arguments": [],
286                        "optional": false,
287                        "loc": {
288                          "start": {
289                            "line": 17,
290                            "column": 12,
291                            "program": "FunctionInSwitch.ets"
292                          },
293                          "end": {
294                            "line": 17,
295                            "column": 16,
296                            "program": "FunctionInSwitch.ets"
297                          }
298                        }
299                      },
300                      "loc": {
301                        "start": {
302                          "line": 17,
303                          "column": 5,
304                          "program": "FunctionInSwitch.ets"
305                        },
306                        "end": {
307                          "line": 17,
308                          "column": 16,
309                          "program": "FunctionInSwitch.ets"
310                        }
311                      }
312                    }
313                  ],
314                  "loc": {
315                    "start": {
316                      "line": 16,
317                      "column": 40,
318                      "program": "FunctionInSwitch.ets"
319                    },
320                    "end": {
321                      "line": 18,
322                      "column": 2,
323                      "program": "FunctionInSwitch.ets"
324                    }
325                  }
326                },
327                "loc": {
328                  "start": {
329                    "line": 16,
330                    "column": 10,
331                    "program": "FunctionInSwitch.ets"
332                  },
333                  "end": {
334                    "line": 18,
335                    "column": 2,
336                    "program": "FunctionInSwitch.ets"
337                  }
338                }
339              },
340              "loc": {
341                "start": {
342                  "line": 16,
343                  "column": 10,
344                  "program": "FunctionInSwitch.ets"
345                },
346                "end": {
347                  "line": 18,
348                  "column": 2,
349                  "program": "FunctionInSwitch.ets"
350                }
351              }
352            },
353            "overloads": [],
354            "decorators": [],
355            "loc": {
356              "start": {
357                "line": 16,
358                "column": 1,
359                "program": "FunctionInSwitch.ets"
360              },
361              "end": {
362                "line": 18,
363                "column": 2,
364                "program": "FunctionInSwitch.ets"
365              }
366            }
367          },
368          {
369            "type": "MethodDefinition",
370            "key": {
371              "type": "Identifier",
372              "name": "with_param",
373              "decorators": [],
374              "loc": {
375                "start": {
376                  "line": 20,
377                  "column": 10,
378                  "program": "FunctionInSwitch.ets"
379                },
380                "end": {
381                  "line": 20,
382                  "column": 20,
383                  "program": "FunctionInSwitch.ets"
384                }
385              }
386            },
387            "kind": "method",
388            "accessibility": "public",
389            "static": true,
390            "optional": false,
391            "computed": false,
392            "value": {
393              "type": "FunctionExpression",
394              "function": {
395                "type": "ScriptFunction",
396                "id": {
397                  "type": "Identifier",
398                  "name": "with_param",
399                  "decorators": [],
400                  "loc": {
401                    "start": {
402                      "line": 20,
403                      "column": 10,
404                      "program": "FunctionInSwitch.ets"
405                    },
406                    "end": {
407                      "line": 20,
408                      "column": 20,
409                      "program": "FunctionInSwitch.ets"
410                    }
411                  }
412                },
413                "generator": false,
414                "async": false,
415                "expression": false,
416                "params": [
417                  {
418                    "type": "ETSParameterExpression",
419                    "name": {
420                      "type": "Identifier",
421                      "name": "fn",
422                      "typeAnnotation": {
423                        "type": "ETSFunctionType",
424                        "params": [],
425                        "returnType": {
426                          "type": "ETSPrimitiveType",
427                          "loc": {
428                            "start": {
429                              "line": 20,
430                              "column": 31,
431                              "program": "FunctionInSwitch.ets"
432                            },
433                            "end": {
434                              "line": 20,
435                              "column": 35,
436                              "program": "FunctionInSwitch.ets"
437                            }
438                          }
439                        },
440                        "loc": {
441                          "start": {
442                            "line": 20,
443                            "column": 25,
444                            "program": "FunctionInSwitch.ets"
445                          },
446                          "end": {
447                            "line": 20,
448                            "column": 35,
449                            "program": "FunctionInSwitch.ets"
450                          }
451                        }
452                      },
453                      "decorators": [],
454                      "loc": {
455                        "start": {
456                          "line": 20,
457                          "column": 21,
458                          "program": "FunctionInSwitch.ets"
459                        },
460                        "end": {
461                          "line": 20,
462                          "column": 35,
463                          "program": "FunctionInSwitch.ets"
464                        }
465                      }
466                    },
467                    "loc": {
468                      "start": {
469                        "line": 20,
470                        "column": 21,
471                        "program": "FunctionInSwitch.ets"
472                      },
473                      "end": {
474                        "line": 20,
475                        "column": 35,
476                        "program": "FunctionInSwitch.ets"
477                      }
478                    }
479                  }
480                ],
481                "returnType": {
482                  "type": "ETSPrimitiveType",
483                  "loc": {
484                    "start": {
485                      "line": 20,
486                      "column": 38,
487                      "program": "FunctionInSwitch.ets"
488                    },
489                    "end": {
490                      "line": 20,
491                      "column": 42,
492                      "program": "FunctionInSwitch.ets"
493                    }
494                  }
495                },
496                "body": {
497                  "type": "BlockStatement",
498                  "statements": [
499                    {
500                      "type": "ExpressionStatement",
501                      "expression": {
502                        "type": "CallExpression",
503                        "callee": {
504                          "type": "Identifier",
505                          "name": "fn",
506                          "decorators": [],
507                          "loc": {
508                            "start": {
509                              "line": 21,
510                              "column": 5,
511                              "program": "FunctionInSwitch.ets"
512                            },
513                            "end": {
514                              "line": 21,
515                              "column": 7,
516                              "program": "FunctionInSwitch.ets"
517                            }
518                          }
519                        },
520                        "arguments": [],
521                        "optional": false,
522                        "loc": {
523                          "start": {
524                            "line": 21,
525                            "column": 5,
526                            "program": "FunctionInSwitch.ets"
527                          },
528                          "end": {
529                            "line": 21,
530                            "column": 9,
531                            "program": "FunctionInSwitch.ets"
532                          }
533                        }
534                      },
535                      "loc": {
536                        "start": {
537                          "line": 21,
538                          "column": 5,
539                          "program": "FunctionInSwitch.ets"
540                        },
541                        "end": {
542                          "line": 21,
543                          "column": 9,
544                          "program": "FunctionInSwitch.ets"
545                        }
546                      }
547                    }
548                  ],
549                  "loc": {
550                    "start": {
551                      "line": 20,
552                      "column": 43,
553                      "program": "FunctionInSwitch.ets"
554                    },
555                    "end": {
556                      "line": 22,
557                      "column": 2,
558                      "program": "FunctionInSwitch.ets"
559                    }
560                  }
561                },
562                "loc": {
563                  "start": {
564                    "line": 20,
565                    "column": 10,
566                    "program": "FunctionInSwitch.ets"
567                  },
568                  "end": {
569                    "line": 22,
570                    "column": 2,
571                    "program": "FunctionInSwitch.ets"
572                  }
573                }
574              },
575              "loc": {
576                "start": {
577                  "line": 20,
578                  "column": 10,
579                  "program": "FunctionInSwitch.ets"
580                },
581                "end": {
582                  "line": 22,
583                  "column": 2,
584                  "program": "FunctionInSwitch.ets"
585                }
586              }
587            },
588            "overloads": [],
589            "decorators": [],
590            "loc": {
591              "start": {
592                "line": 20,
593                "column": 1,
594                "program": "FunctionInSwitch.ets"
595              },
596              "end": {
597                "line": 22,
598                "column": 2,
599                "program": "FunctionInSwitch.ets"
600              }
601            }
602          },
603          {
604            "type": "MethodDefinition",
605            "key": {
606              "type": "Identifier",
607              "name": "main",
608              "decorators": [],
609              "loc": {
610                "start": {
611                  "line": 24,
612                  "column": 10,
613                  "program": "FunctionInSwitch.ets"
614                },
615                "end": {
616                  "line": 24,
617                  "column": 14,
618                  "program": "FunctionInSwitch.ets"
619                }
620              }
621            },
622            "kind": "method",
623            "accessibility": "public",
624            "static": true,
625            "optional": false,
626            "computed": false,
627            "value": {
628              "type": "FunctionExpression",
629              "function": {
630                "type": "ScriptFunction",
631                "id": {
632                  "type": "Identifier",
633                  "name": "main",
634                  "decorators": [],
635                  "loc": {
636                    "start": {
637                      "line": 24,
638                      "column": 10,
639                      "program": "FunctionInSwitch.ets"
640                    },
641                    "end": {
642                      "line": 24,
643                      "column": 14,
644                      "program": "FunctionInSwitch.ets"
645                    }
646                  }
647                },
648                "generator": false,
649                "async": false,
650                "expression": false,
651                "params": [],
652                "returnType": {
653                  "type": "ETSPrimitiveType",
654                  "loc": {
655                    "start": {
656                      "line": 24,
657                      "column": 18,
658                      "program": "FunctionInSwitch.ets"
659                    },
660                    "end": {
661                      "line": 24,
662                      "column": 22,
663                      "program": "FunctionInSwitch.ets"
664                    }
665                  }
666                },
667                "body": {
668                  "type": "BlockStatement",
669                  "statements": [
670                    {
671                      "type": "VariableDeclaration",
672                      "declarations": [
673                        {
674                          "type": "VariableDeclarator",
675                          "id": {
676                            "type": "Identifier",
677                            "name": "switch_arg",
678                            "decorators": [],
679                            "loc": {
680                              "start": {
681                                "line": 25,
682                                "column": 11,
683                                "program": "FunctionInSwitch.ets"
684                              },
685                              "end": {
686                                "line": 25,
687                                "column": 21,
688                                "program": "FunctionInSwitch.ets"
689                              }
690                            }
691                          },
692                          "init": {
693                            "type": "NumberLiteral",
694                            "value": 1,
695                            "loc": {
696                              "start": {
697                                "line": 25,
698                                "column": 24,
699                                "program": "FunctionInSwitch.ets"
700                              },
701                              "end": {
702                                "line": 25,
703                                "column": 25,
704                                "program": "FunctionInSwitch.ets"
705                              }
706                            }
707                          },
708                          "loc": {
709                            "start": {
710                              "line": 25,
711                              "column": 11,
712                              "program": "FunctionInSwitch.ets"
713                            },
714                            "end": {
715                              "line": 25,
716                              "column": 25,
717                              "program": "FunctionInSwitch.ets"
718                            }
719                          }
720                        }
721                      ],
722                      "kind": "const",
723                      "loc": {
724                        "start": {
725                          "line": 25,
726                          "column": 5,
727                          "program": "FunctionInSwitch.ets"
728                        },
729                        "end": {
730                          "line": 25,
731                          "column": 25,
732                          "program": "FunctionInSwitch.ets"
733                        }
734                      }
735                    },
736                    {
737                      "type": "ExpressionStatement",
738                      "expression": {
739                        "type": "CallExpression",
740                        "callee": {
741                          "type": "Identifier",
742                          "name": "with_param",
743                          "decorators": [],
744                          "loc": {
745                            "start": {
746                              "line": 26,
747                              "column": 5,
748                              "program": "FunctionInSwitch.ets"
749                            },
750                            "end": {
751                              "line": 26,
752                              "column": 15,
753                              "program": "FunctionInSwitch.ets"
754                            }
755                          }
756                        },
757                        "arguments": [],
758                        "optional": false,
759                        "loc": {
760                          "start": {
761                            "line": 26,
762                            "column": 5,
763                            "program": "FunctionInSwitch.ets"
764                          },
765                          "end": {
766                            "line": 26,
767                            "column": 17,
768                            "program": "FunctionInSwitch.ets"
769                          }
770                        }
771                      },
772                      "loc": {
773                        "start": {
774                          "line": 26,
775                          "column": 5,
776                          "program": "FunctionInSwitch.ets"
777                        },
778                        "end": {
779                          "line": 26,
780                          "column": 17,
781                          "program": "FunctionInSwitch.ets"
782                        }
783                      }
784                    }
785                  ],
786                  "loc": {
787                    "start": {
788                      "line": 24,
789                      "column": 23,
790                      "program": "FunctionInSwitch.ets"
791                    },
792                    "end": {
793                      "line": 35,
794                      "column": 2,
795                      "program": "FunctionInSwitch.ets"
796                    }
797                  }
798                },
799                "loc": {
800                  "start": {
801                    "line": 24,
802                    "column": 10,
803                    "program": "FunctionInSwitch.ets"
804                  },
805                  "end": {
806                    "line": 35,
807                    "column": 2,
808                    "program": "FunctionInSwitch.ets"
809                  }
810                }
811              },
812              "loc": {
813                "start": {
814                  "line": 24,
815                  "column": 10,
816                  "program": "FunctionInSwitch.ets"
817                },
818                "end": {
819                  "line": 35,
820                  "column": 2,
821                  "program": "FunctionInSwitch.ets"
822                }
823              }
824            },
825            "overloads": [],
826            "decorators": [],
827            "loc": {
828              "start": {
829                "line": 24,
830                "column": 1,
831                "program": "FunctionInSwitch.ets"
832              },
833              "end": {
834                "line": 35,
835                "column": 2,
836                "program": "FunctionInSwitch.ets"
837              }
838            }
839          }
840        ],
841        "loc": {
842          "start": {
843            "line": 1,
844            "column": 1,
845            "program": "FunctionInSwitch.ets"
846          },
847          "end": {
848            "line": 1,
849            "column": 1,
850            "program": "FunctionInSwitch.ets"
851          }
852        }
853      },
854      "loc": {
855        "start": {
856          "line": 1,
857          "column": 1,
858          "program": "FunctionInSwitch.ets"
859        },
860        "end": {
861          "line": 1,
862          "column": 1,
863          "program": "FunctionInSwitch.ets"
864        }
865      }
866    }
867  ],
868  "loc": {
869    "start": {
870      "line": 1,
871      "column": 1,
872      "program": "FunctionInSwitch.ets"
873    },
874    "end": {
875      "line": 36,
876      "column": 1,
877      "program": "FunctionInSwitch.ets"
878    }
879  }
880}
881