Debian Codegraph @

packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":26,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":26,"index":26}},
4 "errors": [
5 "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement. (1:10)"
6 ],
7 "program": {
8 "type": "Program",
9 "start":0,"end":26,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":26,"index":26}},
10 "sourceType": "script",
11 "interpreter": null,
12 "body": [
13 {
14 "type": "WhileStatement",
15 "start":0,"end":26,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":26,"index":26}},
16 "test": {
17 "type": "NumericLiteral",
18 "start":7,"end":8,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":8,"index":8}},
19 "extra": {
20 "rawValue": 1,
21 "raw": "1"
22 },
23 "value": 1
24 },
25 "body": {
26 "type": "FunctionDeclaration",
27 "start":10,"end":26,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":1,"column":26,"index":26}},
28 "id": {
29 "type": "Identifier",
30 "start":19,"end":22,"loc":{"start":{"line":1,"column":19,"index":19},"end":{"line":1,"column":22,"index":22},"identifierName":"foo"},
31 "name": "foo"
32 },
33 "generator": false,
34 "async": false,
35 "params": [],
36 "body": {
37 "type": "BlockStatement",
38 "start":24,"end":26,"loc":{"start":{"line":1,"column":24,"index":24},"end":{"line":1,"column":26,"index":26}},
39 "body": [],
40 "directives": []
41 }
42 }
43 }
44 ],
45 "directives": []
46 }
47 }