swc/crates/swc_ecma_parser/tests/tsc/tsxReactEmit7.json
2022-03-22 07:54:08 +00:00

1140 lines
29 KiB
JSON

{
"type": "Script",
"span": {
"start": 57,
"end": 458,
"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": "VariableDeclaration",
"span": {
"start": 158,
"end": 188,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 162,
"end": 187,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"value": "m",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 166,
"end": 187,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 166,
"end": 181,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 171,
"end": 180,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 171,
"end": 174,
"ctxt": 0
},
"value": "x-y",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 175,
"end": 180,
"ctxt": 0
},
"value": "val",
"raw": "\"val\""
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 181,
"end": 187,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 183,
"end": 186,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 189,
"end": 220,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 193,
"end": 219,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 197,
"end": 219,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 198,
"end": 201,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 197,
"end": 213,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 202,
"end": 212,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 202,
"end": 206,
"ctxt": 0
},
"value": "xx-y",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 207,
"end": 212,
"ctxt": 0
},
"value": "val",
"raw": "\"val\""
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 213,
"end": 219,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 215,
"end": 218,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 221,
"end": 252,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 225,
"end": 251,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "o",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 229,
"end": 251,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 230,
"end": 233,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 229,
"end": 245,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 234,
"end": 244,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"value": "x-yy",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 239,
"end": 244,
"ctxt": 0
},
"value": "val",
"raw": "\"val\""
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 245,
"end": 251,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 247,
"end": 250,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 253,
"end": 285,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 257,
"end": 284,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 257,
"end": 258,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 261,
"end": 284,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 262,
"end": 265,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 261,
"end": 278,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 266,
"end": 277,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 266,
"end": 271,
"ctxt": 0
},
"value": "xx-yy",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 272,
"end": 277,
"ctxt": 0
},
"value": "val",
"raw": "\"val\""
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 278,
"end": 284,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 280,
"end": 283,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 304,
"end": 332,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 308,
"end": 331,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 308,
"end": 309,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 312,
"end": 331,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 313,
"end": 316,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 312,
"end": 325,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 317,
"end": 324,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 319,
"end": 324,
"ctxt": 0
},
"value": "val",
"raw": "\"val\""
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 325,
"end": 331,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 327,
"end": 330,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 333,
"end": 362,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 337,
"end": 361,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 337,
"end": 338,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 341,
"end": 361,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 342,
"end": 345,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 341,
"end": 355,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 346,
"end": 354,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 346,
"end": 348,
"ctxt": 0
},
"value": "xx",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 349,
"end": 354,
"ctxt": 0
},
"value": "val",
"raw": "\"val\""
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 355,
"end": 361,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 357,
"end": 360,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 363,
"end": 393,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 367,
"end": 392,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 371,
"end": 392,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 372,
"end": 375,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 371,
"end": 386,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 376,
"end": 385,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 376,
"end": 379,
"ctxt": 0
},
"value": "xxx",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 380,
"end": 385,
"ctxt": 0
},
"value": "val",
"raw": "\"val\""
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 386,
"end": 392,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 388,
"end": 391,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 394,
"end": 425,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 398,
"end": 424,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 398,
"end": 399,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 402,
"end": 424,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 403,
"end": 406,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 402,
"end": 418,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 407,
"end": 417,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 407,
"end": 411,
"ctxt": 0
},
"value": "xxxx",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 412,
"end": 417,
"ctxt": 0
},
"value": "val",
"raw": "\"val\""
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 418,
"end": 424,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 420,
"end": 423,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 426,
"end": 458,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 430,
"end": 457,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 430,
"end": 431,
"ctxt": 0
},
"value": "e",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 434,
"end": 457,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 435,
"end": 438,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 434,
"end": 451,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 439,
"end": 450,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 439,
"end": 444,
"ctxt": 0
},
"value": "xxxxx",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 445,
"end": 450,
"ctxt": 0
},
"value": "val",
"raw": "\"val\""
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 451,
"end": 457,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 453,
"end": 456,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}