• 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": "func",
11          "decorators": [],
12          "loc": {
13            "start": {
14              "line": 17,
15              "column": 10
16            },
17            "end": {
18              "line": 17,
19              "column": 14
20            }
21          }
22        },
23        "generator": false,
24        "async": false,
25        "expression": false,
26        "params": [
27          {
28            "type": "RestElement",
29            "argument": {
30              "type": "Identifier",
31              "name": "a",
32              "typeAnnotation": {
33                "type": "TSStringKeyword",
34                "loc": {
35                  "start": {
36                    "line": 17,
37                    "column": 21
38                  },
39                  "end": {
40                    "line": 17,
41                    "column": 27
42                  }
43                }
44              },
45              "decorators": [],
46              "loc": {
47                "start": {
48                  "line": 17,
49                  "column": 18
50                },
51                "end": {
52                  "line": 17,
53                  "column": 19
54                }
55              }
56            },
57            "loc": {
58              "start": {
59                "line": 17,
60                "column": 15
61              },
62              "end": {
63                "line": 17,
64                "column": 19
65              }
66            }
67          }
68        ],
69        "body": {
70          "type": "BlockStatement",
71          "statements": [
72            {
73              "type": "ReturnStatement",
74              "argument": {
75                "type": "NumberLiteral",
76                "value": 6,
77                "loc": {
78                  "start": {
79                    "line": 18,
80                    "column": 12
81                  },
82                  "end": {
83                    "line": 18,
84                    "column": 13
85                  }
86                }
87              },
88              "loc": {
89                "start": {
90                  "line": 18,
91                  "column": 5
92                },
93                "end": {
94                  "line": 18,
95                  "column": 14
96                }
97              }
98            }
99          ],
100          "loc": {
101            "start": {
102              "line": 17,
103              "column": 29
104            },
105            "end": {
106              "line": 19,
107              "column": 2
108            }
109          }
110        },
111        "loc": {
112          "start": {
113            "line": 17,
114            "column": 1
115          },
116          "end": {
117            "line": 19,
118            "column": 2
119          }
120        }
121      },
122      "loc": {
123        "start": {
124          "line": 17,
125          "column": 1
126        },
127        "end": {
128          "line": 19,
129          "column": 2
130        }
131      }
132    }
133  ],
134  "loc": {
135    "start": {
136      "line": 1,
137      "column": 1
138    },
139    "end": {
140      "line": 19,
141      "column": 2
142    }
143  }
144}
145TypeError: A rest parameter must be of an array type [functionCall_6.ts:17:15]
146