swc/ecmascript/parser/tests/jsx/basic/21/input.js.json
David Sherret 0d67d5d855 Fix JSX opening, closing, spread child, and expression container spans (#582)
swc_ecma_parser:
 - fix opening and closing jsx spans.
 - fix JSX expression.
 - fix JSX spread child.
2020-01-14 12:37:29 +09:00

158 lines
3.5 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 41,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 0,
"end": 41,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 0,
"end": 41,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 1,
"end": 4,
"ctxt": 0
},
"value": "div",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 0,
"end": 12,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 6,
"end": 9,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 9,
"end": 10,
"ctxt": 0
},
"value": "c",
"typeAnnotation": null,
"optional": false
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 12,
"end": 13,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXSpreadChild",
"span": {
"start": 13,
"end": 26,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 17,
"end": 25,
"ctxt": 0
},
"value": "children",
"typeAnnotation": null,
"optional": false
}
},
{
"type": "JSXExpressionContainer",
"span": {
"start": 26,
"end": 29,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
}
},
{
"type": "JSXSpreadChild",
"span": {
"start": 29,
"end": 35,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 35,
"end": 41,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 37,
"end": 40,
"ctxt": 0
},
"value": "div",
"typeAnnotation": null,
"optional": false
}
}
}
}
],
"interpreter": null
}