• 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": "AssignmentPattern",
29            "left": {
30              "type": "ObjectPattern",
31              "properties": [
32                {
33                  "type": "Property",
34                  "method": false,
35                  "shorthand": true,
36                  "computed": false,
37                  "key": {
38                    "type": "Identifier",
39                    "name": "a",
40                    "decorators": [],
41                    "loc": {
42                      "start": {
43                        "line": 17,
44                        "column": 16
45                      },
46                      "end": {
47                        "line": 17,
48                        "column": 17
49                      }
50                    }
51                  },
52                  "value": {
53                    "type": "Identifier",
54                    "name": "a",
55                    "decorators": [],
56                    "loc": {
57                      "start": {
58                        "line": 17,
59                        "column": 16
60                      },
61                      "end": {
62                        "line": 17,
63                        "column": 17
64                      }
65                    }
66                  },
67                  "kind": "init",
68                  "loc": {
69                    "start": {
70                      "line": 17,
71                      "column": 16
72                    },
73                    "end": {
74                      "line": 17,
75                      "column": 17
76                    }
77                  }
78                },
79                {
80                  "type": "Property",
81                  "method": false,
82                  "shorthand": false,
83                  "computed": false,
84                  "key": {
85                    "type": "Identifier",
86                    "name": "b",
87                    "decorators": [],
88                    "loc": {
89                      "start": {
90                        "line": 17,
91                        "column": 19
92                      },
93                      "end": {
94                        "line": 17,
95                        "column": 20
96                      }
97                    }
98                  },
99                  "value": {
100                    "type": "AssignmentPattern",
101                    "left": {
102                      "type": "ObjectPattern",
103                      "properties": [
104                        {
105                          "type": "Property",
106                          "method": false,
107                          "shorthand": true,
108                          "computed": false,
109                          "key": {
110                            "type": "Identifier",
111                            "name": "t",
112                            "decorators": [],
113                            "loc": {
114                              "start": {
115                                "line": 17,
116                                "column": 24
117                              },
118                              "end": {
119                                "line": 17,
120                                "column": 25
121                              }
122                            }
123                          },
124                          "value": {
125                            "type": "AssignmentPattern",
126                            "left": {
127                              "type": "Identifier",
128                              "name": "t",
129                              "decorators": [],
130                              "loc": {
131                                "start": {
132                                  "line": 17,
133                                  "column": 24
134                                },
135                                "end": {
136                                  "line": 17,
137                                  "column": 25
138                                }
139                              }
140                            },
141                            "right": {
142                              "type": "StringLiteral",
143                              "value": "foo",
144                              "loc": {
145                                "start": {
146                                  "line": 17,
147                                  "column": 28
148                                },
149                                "end": {
150                                  "line": 17,
151                                  "column": 33
152                                }
153                              }
154                            },
155                            "loc": {
156                              "start": {
157                                "line": 17,
158                                "column": 24
159                              },
160                              "end": {
161                                "line": 17,
162                                "column": 33
163                              }
164                            }
165                          },
166                          "kind": "init",
167                          "loc": {
168                            "start": {
169                              "line": 17,
170                              "column": 24
171                            },
172                            "end": {
173                              "line": 17,
174                              "column": 33
175                            }
176                          }
177                        }
178                      ],
179                      "loc": {
180                        "start": {
181                          "line": 17,
182                          "column": 22
183                        },
184                        "end": {
185                          "line": 17,
186                          "column": 35
187                        }
188                      }
189                    },
190                    "right": {
191                      "type": "ObjectExpression",
192                      "properties": [
193                        {
194                          "type": "Property",
195                          "method": false,
196                          "shorthand": false,
197                          "computed": false,
198                          "key": {
199                            "type": "Identifier",
200                            "name": "t",
201                            "decorators": [],
202                            "loc": {
203                              "start": {
204                                "line": 17,
205                                "column": 40
206                              },
207                              "end": {
208                                "line": 17,
209                                "column": 41
210                              }
211                            }
212                          },
213                          "value": {
214                            "type": "NumberLiteral",
215                            "value": 3,
216                            "loc": {
217                              "start": {
218                                "line": 17,
219                                "column": 43
220                              },
221                              "end": {
222                                "line": 17,
223                                "column": 44
224                              }
225                            }
226                          },
227                          "kind": "init",
228                          "loc": {
229                            "start": {
230                              "line": 17,
231                              "column": 40
232                            },
233                            "end": {
234                              "line": 17,
235                              "column": 44
236                            }
237                          }
238                        }
239                      ],
240                      "loc": {
241                        "start": {
242                          "line": 17,
243                          "column": 38
244                        },
245                        "end": {
246                          "line": 17,
247                          "column": 46
248                        }
249                      }
250                    },
251                    "loc": {
252                      "start": {
253                        "line": 17,
254                        "column": 22
255                      },
256                      "end": {
257                        "line": 17,
258                        "column": 46
259                      }
260                    }
261                  },
262                  "kind": "init",
263                  "loc": {
264                    "start": {
265                      "line": 17,
266                      "column": 19
267                    },
268                    "end": {
269                      "line": 17,
270                      "column": 46
271                    }
272                  }
273                },
274                {
275                  "type": "Property",
276                  "method": false,
277                  "shorthand": false,
278                  "computed": false,
279                  "key": {
280                    "type": "Identifier",
281                    "name": "d",
282                    "decorators": [],
283                    "loc": {
284                      "start": {
285                        "line": 17,
286                        "column": 48
287                      },
288                      "end": {
289                        "line": 17,
290                        "column": 49
291                      }
292                    }
293                  },
294                  "value": {
295                    "type": "AssignmentPattern",
296                    "left": {
297                      "type": "ArrayPattern",
298                      "elements": [
299                        {
300                          "type": "AssignmentPattern",
301                          "left": {
302                            "type": "Identifier",
303                            "name": "e",
304                            "decorators": [],
305                            "loc": {
306                              "start": {
307                                "line": 17,
308                                "column": 52
309                              },
310                              "end": {
311                                "line": 17,
312                                "column": 53
313                              }
314                            }
315                          },
316                          "right": {
317                            "type": "ObjectExpression",
318                            "properties": [],
319                            "loc": {
320                              "start": {
321                                "line": 17,
322                                "column": 56
323                              },
324                              "end": {
325                                "line": 17,
326                                "column": 58
327                              }
328                            }
329                          },
330                          "loc": {
331                            "start": {
332                              "line": 17,
333                              "column": 52
334                            },
335                            "end": {
336                              "line": 17,
337                              "column": 58
338                            }
339                          }
340                        },
341                        {
342                          "type": "AssignmentPattern",
343                          "left": {
344                            "type": "Identifier",
345                            "name": "f",
346                            "decorators": [],
347                            "loc": {
348                              "start": {
349                                "line": 17,
350                                "column": 60
351                              },
352                              "end": {
353                                "line": 17,
354                                "column": 61
355                              }
356                            }
357                          },
358                          "right": {
359                            "type": "NumberLiteral",
360                            "value": 6,
361                            "loc": {
362                              "start": {
363                                "line": 17,
364                                "column": 64
365                              },
366                              "end": {
367                                "line": 17,
368                                "column": 65
369                              }
370                            }
371                          },
372                          "loc": {
373                            "start": {
374                              "line": 17,
375                              "column": 60
376                            },
377                            "end": {
378                              "line": 17,
379                              "column": 65
380                            }
381                          }
382                        }
383                      ],
384                      "loc": {
385                        "start": {
386                          "line": 17,
387                          "column": 51
388                        },
389                        "end": {
390                          "line": 17,
391                          "column": 66
392                        }
393                      }
394                    },
395                    "right": {
396                      "type": "ArrayExpression",
397                      "elements": [
398                        {
399                          "type": "NumberLiteral",
400                          "value": 3,
401                          "loc": {
402                            "start": {
403                              "line": 17,
404                              "column": 70
405                            },
406                            "end": {
407                              "line": 17,
408                              "column": 71
409                            }
410                          }
411                        },
412                        {
413                          "type": "ArrayExpression",
414                          "elements": [
415                            {
416                              "type": "StringLiteral",
417                              "value": "foo",
418                              "loc": {
419                                "start": {
420                                  "line": 17,
421                                  "column": 74
422                                },
423                                "end": {
424                                  "line": 17,
425                                  "column": 79
426                                }
427                              }
428                            },
429                            {
430                              "type": "StringLiteral",
431                              "value": "bar",
432                              "loc": {
433                                "start": {
434                                  "line": 17,
435                                  "column": 81
436                                },
437                                "end": {
438                                  "line": 17,
439                                  "column": 86
440                                }
441                              }
442                            }
443                          ],
444                          "loc": {
445                            "start": {
446                              "line": 17,
447                              "column": 73
448                            },
449                            "end": {
450                              "line": 17,
451                              "column": 87
452                            }
453                          }
454                        }
455                      ],
456                      "loc": {
457                        "start": {
458                          "line": 17,
459                          "column": 69
460                        },
461                        "end": {
462                          "line": 17,
463                          "column": 88
464                        }
465                      }
466                    },
467                    "loc": {
468                      "start": {
469                        "line": 17,
470                        "column": 51
471                      },
472                      "end": {
473                        "line": 17,
474                        "column": 88
475                      }
476                    }
477                  },
478                  "kind": "init",
479                  "loc": {
480                    "start": {
481                      "line": 17,
482                      "column": 48
483                    },
484                    "end": {
485                      "line": 17,
486                      "column": 88
487                    }
488                  }
489                }
490              ],
491              "loc": {
492                "start": {
493                  "line": 17,
494                  "column": 14
495                },
496                "end": {
497                  "line": 17,
498                  "column": 90
499                }
500              }
501            },
502            "right": {
503              "type": "ObjectExpression",
504              "properties": [
505                {
506                  "type": "Property",
507                  "method": false,
508                  "shorthand": false,
509                  "computed": false,
510                  "key": {
511                    "type": "Identifier",
512                    "name": "a",
513                    "decorators": [],
514                    "loc": {
515                      "start": {
516                        "line": 17,
517                        "column": 95
518                      },
519                      "end": {
520                        "line": 17,
521                        "column": 96
522                      }
523                    }
524                  },
525                  "value": {
526                    "type": "BooleanLiteral",
527                    "value": true,
528                    "loc": {
529                      "start": {
530                        "line": 17,
531                        "column": 98
532                      },
533                      "end": {
534                        "line": 17,
535                        "column": 102
536                      }
537                    }
538                  },
539                  "kind": "init",
540                  "loc": {
541                    "start": {
542                      "line": 17,
543                      "column": 95
544                    },
545                    "end": {
546                      "line": 17,
547                      "column": 102
548                    }
549                  }
550                }
551              ],
552              "loc": {
553                "start": {
554                  "line": 17,
555                  "column": 93
556                },
557                "end": {
558                  "line": 17,
559                  "column": 104
560                }
561              }
562            },
563            "loc": {
564              "start": {
565                "line": 17,
566                "column": 14
567              },
568              "end": {
569                "line": 17,
570                "column": 104
571              }
572            }
573          }
574        ],
575        "body": {
576          "type": "BlockStatement",
577          "statements": [],
578          "loc": {
579            "start": {
580              "line": 17,
581              "column": 106
582            },
583            "end": {
584              "line": 19,
585              "column": 2
586            }
587          }
588        },
589        "loc": {
590          "start": {
591            "line": 17,
592            "column": 1
593          },
594          "end": {
595            "line": 19,
596            "column": 2
597          }
598        }
599      },
600      "loc": {
601        "start": {
602          "line": 17,
603          "column": 1
604        },
605        "end": {
606          "line": 19,
607          "column": 2
608        }
609      }
610    },
611    {
612      "type": "ExpressionStatement",
613      "expression": {
614        "type": "CallExpression",
615        "callee": {
616          "type": "Identifier",
617          "name": "foo",
618          "decorators": [],
619          "loc": {
620            "start": {
621              "line": 21,
622              "column": 1
623            },
624            "end": {
625              "line": 21,
626              "column": 4
627            }
628          }
629        },
630        "arguments": [
631          {
632            "type": "ObjectExpression",
633            "properties": [
634              {
635                "type": "Property",
636                "method": false,
637                "shorthand": false,
638                "computed": false,
639                "key": {
640                  "type": "Identifier",
641                  "name": "a",
642                  "decorators": [],
643                  "loc": {
644                    "start": {
645                      "line": 21,
646                      "column": 7
647                    },
648                    "end": {
649                      "line": 21,
650                      "column": 8
651                    }
652                  }
653                },
654                "value": {
655                  "type": "NumberLiteral",
656                  "value": 5,
657                  "loc": {
658                    "start": {
659                      "line": 21,
660                      "column": 10
661                    },
662                    "end": {
663                      "line": 21,
664                      "column": 11
665                    }
666                  }
667                },
668                "kind": "init",
669                "loc": {
670                  "start": {
671                    "line": 21,
672                    "column": 7
673                  },
674                  "end": {
675                    "line": 21,
676                    "column": 11
677                  }
678                }
679              }
680            ],
681            "loc": {
682              "start": {
683                "line": 21,
684                "column": 5
685              },
686              "end": {
687                "line": 21,
688                "column": 13
689              }
690            }
691          }
692        ],
693        "optional": false,
694        "loc": {
695          "start": {
696            "line": 21,
697            "column": 1
698          },
699          "end": {
700            "line": 21,
701            "column": 14
702          }
703        }
704      },
705      "loc": {
706        "start": {
707          "line": 21,
708          "column": 1
709        },
710        "end": {
711          "line": 21,
712          "column": 15
713        }
714      }
715    }
716  ],
717  "loc": {
718    "start": {
719      "line": 1,
720      "column": 1
721    },
722    "end": {
723      "line": 21,
724      "column": 15
725    }
726  }
727}
728TypeError: Type 'number' is not assignable to type 'boolean'. [functionWithPattern5.ts:21:7]
729