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