swc/ecmascript/parser/tests/jsx/basic/issue-2264/input.js.json
Donny/강동윤 ca0d6ddf2e
fix(es/parser): Fix bugs (#2255)
swc_ecma_parser:
 - Treat `{` after an arrow as a brace stmt. (#2237)
 - Handle comments correctly while backtracking. (#2264)
2021-09-23 11:32:40 +00:00

103 lines
2.3 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 45,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 45,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 6,
"end": 45,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 6,
"end": 7,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 10,
"end": 45,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 11,
"end": 17,
"ctxt": 0
},
"value": "Switch",
"optional": false
},
"span": {
"start": 10,
"end": 18,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 18,
"end": 36,
"ctxt": 0
},
"value": "\n\n // 1\n\n /* 2 */\n\n",
"raw": "\n\n // 1\n\n /* 2 */\n\n"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 36,
"end": 45,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 38,
"end": 44,
"ctxt": 0
},
"value": "Switch",
"optional": false
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}