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

354 lines
8.8 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 60,
"end": 255,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 60,
"end": 84,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 74,
"end": 84,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 74,
"end": 79,
"ctxt": 0
},
"value": "React",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 79,
"end": 84,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 81,
"end": 84,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 85,
"end": 175,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 103,
"end": 106,
"ctxt": 0
},
"value": "JSX",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 107,
"end": 175,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 113,
"end": 173,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 123,
"end": 140,
"ctxt": 0
},
"value": "IntrinsicElements",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 141,
"end": 173,
"ctxt": 0
},
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 152,
"end": 161,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 153,
"end": 161,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 155,
"end": 161,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 162,
"end": 167,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 164,
"end": 167,
"ctxt": 0
},
"kind": "any"
}
},
"readonly": false,
"static": false,
"span": {
"start": 151,
"end": 167,
"ctxt": 0
}
}
]
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 177,
"end": 219,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 183,
"end": 218,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 183,
"end": 184,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 187,
"end": 218,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 191,
"end": 216,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 192,
"end": 202,
"ctxt": 0
},
"value": "public-foo",
"optional": false
},
"span": {
"start": 191,
"end": 203,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 203,
"end": 216,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 205,
"end": 215,
"ctxt": 0
},
"value": "public-foo",
"optional": false
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 221,
"end": 255,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 227,
"end": 254,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 231,
"end": 254,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 235,
"end": 252,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 236,
"end": 242,
"ctxt": 0
},
"value": "public",
"optional": false
},
"span": {
"start": 235,
"end": 243,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 243,
"end": 252,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 245,
"end": 251,
"ctxt": 0
},
"value": "public",
"optional": false
}
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}