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

562 lines
16 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 57,
"end": 420,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 57,
"end": 156,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 75,
"ctxt": 0
},
"value": "JSX",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 76,
"end": 156,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 79,
"end": 100,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 89,
"end": 96,
"ctxt": 0
},
"value": "Element",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 97,
"end": 100,
"ctxt": 0
},
"body": []
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 102,
"end": 154,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 112,
"end": 129,
"ctxt": 0
},
"value": "IntrinsicElements",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 130,
"end": 154,
"ctxt": 0
},
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 135,
"end": 144,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 136,
"end": 144,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 138,
"end": 144,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 145,
"end": 150,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 147,
"end": 150,
"ctxt": 0
},
"kind": "any"
}
},
"readonly": false,
"static": false,
"span": {
"start": 134,
"end": 151,
"ctxt": 0
}
}
]
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 190,
"end": 229,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 202,
"end": 229,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 205,
"end": 227,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 212,
"end": 227,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 216,
"end": 226,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 216,
"end": 221,
"ctxt": 0
},
"value": "React",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 221,
"end": 226,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 223,
"end": 226,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 231,
"end": 420,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 243,
"end": 420,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 310,
"end": 323,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 314,
"end": 322,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 314,
"end": 317,
"ctxt": 0
},
"value": "foo",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 317,
"end": 322,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 319,
"end": 322,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 325,
"end": 366,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 329,
"end": 365,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 329,
"end": 336,
"ctxt": 0
},
"value": "spread1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 339,
"end": 365,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 340,
"end": 343,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 339,
"end": 365,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 344,
"end": 348,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 346,
"end": 348,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "SpreadElement",
"spread": {
"start": 350,
"end": 353,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 353,
"end": 356,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
{
"type": "JSXAttribute",
"span": {
"start": 358,
"end": 362,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 360,
"end": 362,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 380,
"end": 418,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 384,
"end": 417,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 384,
"end": 385,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 388,
"end": 417,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 389,
"end": 392,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 388,
"end": 393,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 393,
"end": 411,
"ctxt": 0
},
"value": "This \"quote\" thing",
"raw": "This \"quote\" thing"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 411,
"end": 417,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 413,
"end": 416,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}