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

148 lines
3.4 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 53,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 0,
"end": 53,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 0,
"end": 53,
"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": 47,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 5,
"end": 18,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 5,
"end": 8,
"ctxt": 0
},
"value": "pre",
"typeAnnotation": null,
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 9,
"end": 18,
"ctxt": 0
},
"value": "leading",
"hasEscape": false
}
},
{
"type": "JSXAttribute",
"span": {
"start": 19,
"end": 35,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 19,
"end": 23,
"ctxt": 0
},
"value": "pre2",
"typeAnnotation": null,
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 24,
"end": 35,
"ctxt": 0
},
"value": "attribute",
"hasEscape": false
}
},
{
"type": "SpreadElement",
"spread": {
"start": 37,
"end": 40,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 40,
"end": 45,
"ctxt": 0
},
"value": "props",
"typeAnnotation": null,
"optional": false
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 47,
"end": 53,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 49,
"end": 52,
"ctxt": 0
},
"value": "div",
"typeAnnotation": null,
"optional": false
}
}
}
}
],
"interpreter": null
}