• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "type": "Program",
3  "statements": [
4    {
5      "type": "FunctionDeclaration",
6      "function": {
7        "type": "ScriptFunction",
8        "id": {
9          "type": "Identifier",
10          "name": "foo",
11          "decorators": [],
12          "loc": {
13            "start": {
14              "line": 17,
15              "column": 10
16            },
17            "end": {
18              "line": 17,
19              "column": 13
20            }
21          }
22        },
23        "generator": false,
24        "async": false,
25        "expression": false,
26        "params": [
27          {
28            "type": "ArrayPattern",
29            "elements": [
30              {
31                "type": "AssignmentPattern",
32                "left": {
33                  "type": "Identifier",
34                  "name": "a",
35                  "decorators": [],
36                  "loc": {
37                    "start": {
38                      "line": 17,
39                      "column": 15
40                    },
41                    "end": {
42                      "line": 17,
43                      "column": 16
44                    }
45                  }
46                },
47                "right": {
48                  "type": "NumberLiteral",
49                  "value": 2,
50                  "loc": {
51                    "start": {
52                      "line": 17,
53                      "column": 19
54                    },
55                    "end": {
56                      "line": 17,
57                      "column": 20
58                    }
59                  }
60                },
61                "loc": {
62                  "start": {
63                    "line": 17,
64                    "column": 15
65                  },
66                  "end": {
67                    "line": 17,
68                    "column": 20
69                  }
70                }
71              },
72              {
73                "type": "ObjectPattern",
74                "properties": [
75                  {
76                    "type": "Property",
77                    "method": false,
78                    "shorthand": false,
79                    "computed": false,
80                    "key": {
81                      "type": "Identifier",
82                      "name": "b",
83                      "decorators": [],
84                      "loc": {
85                        "start": {
86                          "line": 17,
87                          "column": 24
88                        },
89                        "end": {
90                          "line": 17,
91                          "column": 25
92                        }
93                      }
94                    },
95                    "value": {
96                      "type": "AssignmentPattern",
97                      "left": {
98                        "type": "ArrayPattern",
99                        "elements": [
100                          {
101                            "type": "AssignmentPattern",
102                            "left": {
103                              "type": "Identifier",
104                              "name": "c",
105                              "decorators": [],
106                              "loc": {
107                                "start": {
108                                  "line": 17,
109                                  "column": 28
110                                },
111                                "end": {
112                                  "line": 17,
113                                  "column": 29
114                                }
115                              }
116                            },
117                            "right": {
118                              "type": "NumberLiteral",
119                              "value": 6,
120                              "loc": {
121                                "start": {
122                                  "line": 17,
123                                  "column": 32
124                                },
125                                "end": {
126                                  "line": 17,
127                                  "column": 33
128                                }
129                              }
130                            },
131                            "loc": {
132                              "start": {
133                                "line": 17,
134                                "column": 28
135                              },
136                              "end": {
137                                "line": 17,
138                                "column": 33
139                              }
140                            }
141                          },
142                          {
143                            "type": "Identifier",
144                            "name": "d",
145                            "decorators": [],
146                            "loc": {
147                              "start": {
148                                "line": 17,
149                                "column": 35
150                              },
151                              "end": {
152                                "line": 17,
153                                "column": 36
154                              }
155                            }
156                          }
157                        ],
158                        "loc": {
159                          "start": {
160                            "line": 17,
161                            "column": 27
162                          },
163                          "end": {
164                            "line": 17,
165                            "column": 37
166                          }
167                        }
168                      },
169                      "right": {
170                        "type": "ArrayExpression",
171                        "elements": [
172                          {
173                            "type": "BooleanLiteral",
174                            "value": true,
175                            "loc": {
176                              "start": {
177                                "line": 17,
178                                "column": 41
179                              },
180                              "end": {
181                                "line": 17,
182                                "column": 45
183                              }
184                            }
185                          },
186                          {
187                            "type": "ArrayExpression",
188                            "elements": [
189                              {
190                                "type": "BigIntLiteral",
191                                "value": "5",
192                                "loc": {
193                                  "start": {
194                                    "line": 17,
195                                    "column": 48
196                                  },
197                                  "end": {
198                                    "line": 17,
199                                    "column": 50
200                                  }
201                                }
202                              },
203                              {
204                                "type": "StringLiteral",
205                                "value": "foo",
206                                "loc": {
207                                  "start": {
208                                    "line": 17,
209                                    "column": 52
210                                  },
211                                  "end": {
212                                    "line": 17,
213                                    "column": 57
214                                  }
215                                }
216                              }
217                            ],
218                            "loc": {
219                              "start": {
220                                "line": 17,
221                                "column": 47
222                              },
223                              "end": {
224                                "line": 17,
225                                "column": 58
226                              }
227                            }
228                          }
229                        ],
230                        "loc": {
231                          "start": {
232                            "line": 17,
233                            "column": 40
234                          },
235                          "end": {
236                            "line": 17,
237                            "column": 59
238                          }
239                        }
240                      },
241                      "loc": {
242                        "start": {
243                          "line": 17,
244                          "column": 27
245                        },
246                        "end": {
247                          "line": 17,
248                          "column": 59
249                        }
250                      }
251                    },
252                    "kind": "init",
253                    "loc": {
254                      "start": {
255                        "line": 17,
256                        "column": 24
257                      },
258                      "end": {
259                        "line": 17,
260                        "column": 59
261                      }
262                    }
263                  },
264                  {
265                    "type": "Property",
266                    "method": false,
267                    "shorthand": true,
268                    "computed": false,
269                    "key": {
270                      "type": "Identifier",
271                      "name": "t",
272                      "decorators": [],
273                      "loc": {
274                        "start": {
275                          "line": 17,
276                          "column": 61
277                        },
278                        "end": {
279                          "line": 17,
280                          "column": 62
281                        }
282                      }
283                    },
284                    "value": {
285                      "type": "AssignmentPattern",
286                      "left": {
287                        "type": "Identifier",
288                        "name": "t",
289                        "decorators": [],
290                        "loc": {
291                          "start": {
292                            "line": 17,
293                            "column": 61
294                          },
295                          "end": {
296                            "line": 17,
297                            "column": 62
298                          }
299                        }
300                      },
301                      "right": {
302                        "type": "ObjectExpression",
303                        "properties": [
304                          {
305                            "type": "Property",
306                            "method": false,
307                            "shorthand": false,
308                            "computed": false,
309                            "key": {
310                              "type": "Identifier",
311                              "name": "a",
312                              "decorators": [],
313                              "loc": {
314                                "start": {
315                                  "line": 17,
316                                  "column": 67
317                                },
318                                "end": {
319                                  "line": 17,
320                                  "column": 68
321                                }
322                              }
323                            },
324                            "value": {
325                              "type": "NumberLiteral",
326                              "value": 3,
327                              "loc": {
328                                "start": {
329                                  "line": 17,
330                                  "column": 70
331                                },
332                                "end": {
333                                  "line": 17,
334                                  "column": 71
335                                }
336                              }
337                            },
338                            "kind": "init",
339                            "loc": {
340                              "start": {
341                                "line": 17,
342                                "column": 67
343                              },
344                              "end": {
345                                "line": 17,
346                                "column": 71
347                              }
348                            }
349                          },
350                          {
351                            "type": "Property",
352                            "method": false,
353                            "shorthand": false,
354                            "computed": false,
355                            "key": {
356                              "type": "Identifier",
357                              "name": "b",
358                              "decorators": [],
359                              "loc": {
360                                "start": {
361                                  "line": 17,
362                                  "column": 73
363                                },
364                                "end": {
365                                  "line": 17,
366                                  "column": 74
367                                }
368                              }
369                            },
370                            "value": {
371                              "type": "ObjectExpression",
372                              "properties": [
373                                {
374                                  "type": "Property",
375                                  "method": false,
376                                  "shorthand": false,
377                                  "computed": false,
378                                  "key": {
379                                    "type": "Identifier",
380                                    "name": "a",
381                                    "decorators": [],
382                                    "loc": {
383                                      "start": {
384                                        "line": 17,
385                                        "column": 78
386                                      },
387                                      "end": {
388                                        "line": 17,
389                                        "column": 79
390                                      }
391                                    }
392                                  },
393                                  "value": {
394                                    "type": "NumberLiteral",
395                                    "value": 2,
396                                    "loc": {
397                                      "start": {
398                                        "line": 17,
399                                        "column": 81
400                                      },
401                                      "end": {
402                                        "line": 17,
403                                        "column": 82
404                                      }
405                                    }
406                                  },
407                                  "kind": "init",
408                                  "loc": {
409                                    "start": {
410                                      "line": 17,
411                                      "column": 78
412                                    },
413                                    "end": {
414                                      "line": 17,
415                                      "column": 82
416                                    }
417                                  }
418                                },
419                                {
420                                  "type": "Property",
421                                  "method": false,
422                                  "shorthand": false,
423                                  "computed": false,
424                                  "key": {
425                                    "type": "Identifier",
426                                    "name": "b",
427                                    "decorators": [],
428                                    "loc": {
429                                      "start": {
430                                        "line": 17,
431                                        "column": 84
432                                      },
433                                      "end": {
434                                        "line": 17,
435                                        "column": 85
436                                      }
437                                    }
438                                  },
439                                  "value": {
440                                    "type": "BigIntLiteral",
441                                    "value": "5",
442                                    "loc": {
443                                      "start": {
444                                        "line": 17,
445                                        "column": 87
446                                      },
447                                      "end": {
448                                        "line": 17,
449                                        "column": 89
450                                      }
451                                    }
452                                  },
453                                  "kind": "init",
454                                  "loc": {
455                                    "start": {
456                                      "line": 17,
457                                      "column": 84
458                                    },
459                                    "end": {
460                                      "line": 17,
461                                      "column": 89
462                                    }
463                                  }
464                                }
465                              ],
466                              "loc": {
467                                "start": {
468                                  "line": 17,
469                                  "column": 76
470                                },
471                                "end": {
472                                  "line": 17,
473                                  "column": 91
474                                }
475                              }
476                            },
477                            "kind": "init",
478                            "loc": {
479                              "start": {
480                                "line": 17,
481                                "column": 73
482                              },
483                              "end": {
484                                "line": 17,
485                                "column": 91
486                              }
487                            }
488                          }
489                        ],
490                        "loc": {
491                          "start": {
492                            "line": 17,
493                            "column": 65
494                          },
495                          "end": {
496                            "line": 17,
497                            "column": 93
498                          }
499                        }
500                      },
501                      "loc": {
502                        "start": {
503                          "line": 17,
504                          "column": 61
505                        },
506                        "end": {
507                          "line": 17,
508                          "column": 93
509                        }
510                      }
511                    },
512                    "kind": "init",
513                    "loc": {
514                      "start": {
515                        "line": 17,
516                        "column": 61
517                      },
518                      "end": {
519                        "line": 17,
520                        "column": 93
521                      }
522                    }
523                  }
524                ],
525                "loc": {
526                  "start": {
527                    "line": 17,
528                    "column": 22
529                  },
530                  "end": {
531                    "line": 17,
532                    "column": 95
533                  }
534                }
535              }
536            ],
537            "loc": {
538              "start": {
539                "line": 17,
540                "column": 14
541              },
542              "end": {
543                "line": 17,
544                "column": 96
545              }
546            }
547          },
548          {
549            "type": "ObjectPattern",
550            "properties": [
551              {
552                "type": "Property",
553                "method": false,
554                "shorthand": false,
555                "computed": false,
556                "key": {
557                  "type": "Identifier",
558                  "name": "r",
559                  "decorators": [],
560                  "loc": {
561                    "start": {
562                      "line": 17,
563                      "column": 100
564                    },
565                    "end": {
566                      "line": 17,
567                      "column": 101
568                    }
569                  }
570                },
571                "value": {
572                  "type": "AssignmentPattern",
573                  "left": {
574                    "type": "ArrayPattern",
575                    "elements": [
576                      {
577                        "type": "AssignmentPattern",
578                        "left": {
579                          "type": "ArrayPattern",
580                          "elements": [
581                            {
582                              "type": "Identifier",
583                              "name": "r",
584                              "decorators": [],
585                              "loc": {
586                                "start": {
587                                  "line": 17,
588                                  "column": 105
589                                },
590                                "end": {
591                                  "line": 17,
592                                  "column": 106
593                                }
594                              }
595                            },
596                            {
597                              "type": "AssignmentPattern",
598                              "left": {
599                                "type": "Identifier",
600                                "name": "z",
601                                "decorators": [],
602                                "loc": {
603                                  "start": {
604                                    "line": 17,
605                                    "column": 108
606                                  },
607                                  "end": {
608                                    "line": 17,
609                                    "column": 109
610                                  }
611                                }
612                              },
613                              "right": {
614                                "type": "NumberLiteral",
615                                "value": 5,
616                                "loc": {
617                                  "start": {
618                                    "line": 17,
619                                    "column": 112
620                                  },
621                                  "end": {
622                                    "line": 17,
623                                    "column": 113
624                                  }
625                                }
626                              },
627                              "loc": {
628                                "start": {
629                                  "line": 17,
630                                  "column": 108
631                                },
632                                "end": {
633                                  "line": 17,
634                                  "column": 113
635                                }
636                              }
637                            }
638                          ],
639                          "loc": {
640                            "start": {
641                              "line": 17,
642                              "column": 104
643                            },
644                            "end": {
645                              "line": 17,
646                              "column": 114
647                            }
648                          }
649                        },
650                        "right": {
651                          "type": "ArrayExpression",
652                          "elements": [
653                            {
654                              "type": "BooleanLiteral",
655                              "value": true,
656                              "loc": {
657                                "start": {
658                                  "line": 17,
659                                  "column": 118
660                                },
661                                "end": {
662                                  "line": 17,
663                                  "column": 122
664                                }
665                              }
666                            }
667                          ],
668                          "loc": {
669                            "start": {
670                              "line": 17,
671                              "column": 117
672                            },
673                            "end": {
674                              "line": 17,
675                              "column": 123
676                            }
677                          }
678                        },
679                        "loc": {
680                          "start": {
681                            "line": 17,
682                            "column": 104
683                          },
684                          "end": {
685                            "line": 17,
686                            "column": 123
687                          }
688                        }
689                      }
690                    ],
691                    "loc": {
692                      "start": {
693                        "line": 17,
694                        "column": 103
695                      },
696                      "end": {
697                        "line": 17,
698                        "column": 124
699                      }
700                    }
701                  },
702                  "right": {
703                    "type": "ArrayExpression",
704                    "elements": [
705                      {
706                        "type": "ArrayExpression",
707                        "elements": [
708                          {
709                            "type": "NumberLiteral",
710                            "value": 2,
711                            "loc": {
712                              "start": {
713                                "line": 17,
714                                "column": 129
715                              },
716                              "end": {
717                                "line": 17,
718                                "column": 130
719                              }
720                            }
721                          },
722                          {
723                            "type": "StringLiteral",
724                            "value": "foo",
725                            "loc": {
726                              "start": {
727                                "line": 17,
728                                "column": 132
729                              },
730                              "end": {
731                                "line": 17,
732                                "column": 137
733                              }
734                            }
735                          }
736                        ],
737                        "loc": {
738                          "start": {
739                            "line": 17,
740                            "column": 128
741                          },
742                          "end": {
743                            "line": 17,
744                            "column": 138
745                          }
746                        }
747                      }
748                    ],
749                    "loc": {
750                      "start": {
751                        "line": 17,
752                        "column": 127
753                      },
754                      "end": {
755                        "line": 17,
756                        "column": 139
757                      }
758                    }
759                  },
760                  "loc": {
761                    "start": {
762                      "line": 17,
763                      "column": 103
764                    },
765                    "end": {
766                      "line": 17,
767                      "column": 139
768                    }
769                  }
770                },
771                "kind": "init",
772                "loc": {
773                  "start": {
774                    "line": 17,
775                    "column": 100
776                  },
777                  "end": {
778                    "line": 17,
779                    "column": 139
780                  }
781                }
782              }
783            ],
784            "loc": {
785              "start": {
786                "line": 17,
787                "column": 98
788              },
789              "end": {
790                "line": 17,
791                "column": 141
792              }
793            }
794          }
795        ],
796        "body": {
797          "type": "BlockStatement",
798          "statements": [],
799          "loc": {
800            "start": {
801              "line": 17,
802              "column": 143
803            },
804            "end": {
805              "line": 19,
806              "column": 2
807            }
808          }
809        },
810        "loc": {
811          "start": {
812            "line": 17,
813            "column": 1
814          },
815          "end": {
816            "line": 19,
817            "column": 2
818          }
819        }
820      },
821      "loc": {
822        "start": {
823          "line": 17,
824          "column": 1
825        },
826        "end": {
827          "line": 19,
828          "column": 2
829        }
830      }
831    },
832    {
833      "type": "ExpressionStatement",
834      "expression": {
835        "type": "CallExpression",
836        "callee": {
837          "type": "Identifier",
838          "name": "foo",
839          "decorators": [],
840          "loc": {
841            "start": {
842              "line": 21,
843              "column": 1
844            },
845            "end": {
846              "line": 21,
847              "column": 4
848            }
849          }
850        },
851        "arguments": [
852          {
853            "type": "ArrayExpression",
854            "elements": [
855              {
856                "type": "NumberLiteral",
857                "value": 2,
858                "loc": {
859                  "start": {
860                    "line": 21,
861                    "column": 6
862                  },
863                  "end": {
864                    "line": 21,
865                    "column": 7
866                  }
867                }
868              },
869              {
870                "type": "ObjectExpression",
871                "properties": [
872                  {
873                    "type": "Property",
874                    "method": false,
875                    "shorthand": false,
876                    "computed": false,
877                    "key": {
878                      "type": "Identifier",
879                      "name": "b",
880                      "decorators": [],
881                      "loc": {
882                        "start": {
883                          "line": 21,
884                          "column": 11
885                        },
886                        "end": {
887                          "line": 21,
888                          "column": 12
889                        }
890                      }
891                    },
892                    "value": {
893                      "type": "ArrayExpression",
894                      "elements": [
895                        {
896                          "type": "BooleanLiteral",
897                          "value": true,
898                          "loc": {
899                            "start": {
900                              "line": 21,
901                              "column": 15
902                            },
903                            "end": {
904                              "line": 21,
905                              "column": 19
906                            }
907                          }
908                        },
909                        {
910                          "type": "ArrayExpression",
911                          "elements": [],
912                          "loc": {
913                            "start": {
914                              "line": 21,
915                              "column": 21
916                            },
917                            "end": {
918                              "line": 21,
919                              "column": 23
920                            }
921                          }
922                        }
923                      ],
924                      "loc": {
925                        "start": {
926                          "line": 21,
927                          "column": 14
928                        },
929                        "end": {
930                          "line": 21,
931                          "column": 24
932                        }
933                      }
934                    },
935                    "kind": "init",
936                    "loc": {
937                      "start": {
938                        "line": 21,
939                        "column": 11
940                      },
941                      "end": {
942                        "line": 21,
943                        "column": 24
944                      }
945                    }
946                  },
947                  {
948                    "type": "Property",
949                    "method": false,
950                    "shorthand": false,
951                    "computed": false,
952                    "key": {
953                      "type": "Identifier",
954                      "name": "t",
955                      "decorators": [],
956                      "loc": {
957                        "start": {
958                          "line": 21,
959                          "column": 26
960                        },
961                        "end": {
962                          "line": 21,
963                          "column": 27
964                        }
965                      }
966                    },
967                    "value": {
968                      "type": "ObjectExpression",
969                      "properties": [
970                        {
971                          "type": "Property",
972                          "method": false,
973                          "shorthand": false,
974                          "computed": false,
975                          "key": {
976                            "type": "Identifier",
977                            "name": "a",
978                            "decorators": [],
979                            "loc": {
980                              "start": {
981                                "line": 21,
982                                "column": 31
983                              },
984                              "end": {
985                                "line": 21,
986                                "column": 32
987                              }
988                            }
989                          },
990                          "value": {
991                            "type": "NumberLiteral",
992                            "value": 1,
993                            "loc": {
994                              "start": {
995                                "line": 21,
996                                "column": 34
997                              },
998                              "end": {
999                                "line": 21,
1000                                "column": 35
1001                              }
1002                            }
1003                          },
1004                          "kind": "init",
1005                          "loc": {
1006                            "start": {
1007                              "line": 21,
1008                              "column": 31
1009                            },
1010                            "end": {
1011                              "line": 21,
1012                              "column": 35
1013                            }
1014                          }
1015                        },
1016                        {
1017                          "type": "Property",
1018                          "method": false,
1019                          "shorthand": false,
1020                          "computed": false,
1021                          "key": {
1022                            "type": "Identifier",
1023                            "name": "z",
1024                            "decorators": [],
1025                            "loc": {
1026                              "start": {
1027                                "line": 21,
1028                                "column": 37
1029                              },
1030                              "end": {
1031                                "line": 21,
1032                                "column": 38
1033                              }
1034                            }
1035                          },
1036                          "value": {
1037                            "type": "StringLiteral",
1038                            "value": "foo",
1039                            "loc": {
1040                              "start": {
1041                                "line": 21,
1042                                "column": 40
1043                              },
1044                              "end": {
1045                                "line": 21,
1046                                "column": 45
1047                              }
1048                            }
1049                          },
1050                          "kind": "init",
1051                          "loc": {
1052                            "start": {
1053                              "line": 21,
1054                              "column": 37
1055                            },
1056                            "end": {
1057                              "line": 21,
1058                              "column": 45
1059                            }
1060                          }
1061                        }
1062                      ],
1063                      "loc": {
1064                        "start": {
1065                          "line": 21,
1066                          "column": 29
1067                        },
1068                        "end": {
1069                          "line": 21,
1070                          "column": 47
1071                        }
1072                      }
1073                    },
1074                    "kind": "init",
1075                    "loc": {
1076                      "start": {
1077                        "line": 21,
1078                        "column": 26
1079                      },
1080                      "end": {
1081                        "line": 21,
1082                        "column": 47
1083                      }
1084                    }
1085                  }
1086                ],
1087                "loc": {
1088                  "start": {
1089                    "line": 21,
1090                    "column": 9
1091                  },
1092                  "end": {
1093                    "line": 21,
1094                    "column": 49
1095                  }
1096                }
1097              },
1098              {
1099                "type": "BigIntLiteral",
1100                "value": "5",
1101                "loc": {
1102                  "start": {
1103                    "line": 21,
1104                    "column": 51
1105                  },
1106                  "end": {
1107                    "line": 21,
1108                    "column": 53
1109                  }
1110                }
1111              }
1112            ],
1113            "loc": {
1114              "start": {
1115                "line": 21,
1116                "column": 5
1117              },
1118              "end": {
1119                "line": 21,
1120                "column": 54
1121              }
1122            }
1123          },
1124          {
1125            "type": "ObjectExpression",
1126            "properties": [],
1127            "loc": {
1128              "start": {
1129                "line": 21,
1130                "column": 56
1131              },
1132              "end": {
1133                "line": 21,
1134                "column": 58
1135              }
1136            }
1137          }
1138        ],
1139        "optional": false,
1140        "loc": {
1141          "start": {
1142            "line": 21,
1143            "column": 1
1144          },
1145          "end": {
1146            "line": 21,
1147            "column": 59
1148          }
1149        }
1150      },
1151      "loc": {
1152        "start": {
1153          "line": 21,
1154          "column": 1
1155        },
1156        "end": {
1157          "line": 21,
1158          "column": 60
1159        }
1160      }
1161    }
1162  ],
1163  "loc": {
1164    "start": {
1165      "line": 1,
1166      "column": 1
1167    },
1168    "end": {
1169      "line": 22,
1170      "column": 1
1171    }
1172  }
1173}
1174TypeError: Object literal may only specify known properties, and "z" does not exist in type '{ a: number; b: { a: number; b: bigint; }; }'. [functionWithPattern11.ts:21:37]
1175