swc/crates/swc_ecma_parser/tests/tsc/tsxReactEmit3.json

435 lines
9.9 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 37,
"end": 186,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 37,
"end": 81,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 52,
"end": 55,
"ctxt": 0
},
"value": "JSX",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 56,
"end": 81,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 58,
"end": 79,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 68,
"end": 75,
"ctxt": 0
},
"value": "Element",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 76,
"end": 79,
"ctxt": 0
},
"body": []
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 82,
"end": 105,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 94,
"end": 104,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 99,
"ctxt": 0
},
"value": "React",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 99,
"end": 104,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 101,
"end": 104,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 107,
"end": 133,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"value": "Foo",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 124,
"end": 127,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 124,
"end": 127,
"ctxt": 0
},
"value": "Bar",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 129,
"end": 132,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 129,
"end": 132,
"ctxt": 0
},
"value": "baz",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 135,
"end": 186,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 135,
"end": 185,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 136,
"end": 139,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 135,
"end": 140,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXElement",
"span": {
"start": 141,
"end": 155,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 142,
"end": 145,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"span": {
"start": 141,
"end": 146,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 146,
"end": 149,
"ctxt": 0
},
"value": " q ",
"raw": " q "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 149,
"end": 155,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 151,
"end": 154,
"ctxt": 0
},
"value": "Bar",
"optional": false
}
}
},
{
"type": "JSXText",
"span": {
"start": 155,
"end": 156,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXElement",
"span": {
"start": 156,
"end": 162,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 157,
"end": 160,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"span": {
"start": 156,
"end": 162,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
{
"type": "JSXText",
"span": {
"start": 162,
"end": 167,
"ctxt": 0
},
"value": " s ",
"raw": " s "
},
{
"type": "JSXElement",
"span": {
"start": 167,
"end": 173,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 168,
"end": 171,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"span": {
"start": 167,
"end": 173,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
{
"type": "JSXElement",
"span": {
"start": 173,
"end": 179,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 174,
"end": 177,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"span": {
"start": 173,
"end": 179,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 179,
"end": 185,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
}
}
}
],
"interpreter": null
}