swc/ecmascript/parser/tests/jsx/basic/7/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

111 lines
2.4 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 51,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 0,
"end": 51,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 0,
"end": 51,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 1,
"end": 8,
"ctxt": 0
},
"value": "AbC-def",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 0,
"end": 32,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 11,
"end": 31,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 11,
"end": 15,
"ctxt": 0
},
"value": "test",
"typeAnnotation": null,
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 16,
"end": 31,
"ctxt": 0
},
"value": "&&",
"hasEscape": false
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 32,
"end": 41,
"ctxt": 0
},
"value": "\n\nbar\n\nbaz\n\n",
"raw": "\n\nbar\n\nbaz\n\n"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 41,
"end": 51,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 43,
"end": 50,
"ctxt": 0
},
"value": "AbC-def",
"typeAnnotation": null,
"optional": false
}
}
}
}
],
"interpreter": null
}