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

1544 lines
40 KiB
JSON

{
"type": "Script",
"span": {
"start": 39,
"end": 686,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 39,
"end": 167,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"value": "JSX",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 58,
"end": 167,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 61,
"end": 82,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 71,
"end": 78,
"ctxt": 0
},
"value": "Element",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 79,
"end": 82,
"ctxt": 0
},
"body": []
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 84,
"end": 132,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 119,
"ctxt": 0
},
"value": "ElementAttributesProperty",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 120,
"end": 132,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 122,
"end": 130,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 122,
"end": 124,
"ctxt": 0
},
"value": "pr",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 124,
"end": 129,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 126,
"end": 129,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 134,
"end": 165,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 144,
"end": 161,
"ctxt": 0
},
"value": "IntrinsicElements",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 162,
"end": 165,
"ctxt": 0
},
"body": []
}
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 169,
"end": 213,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 179,
"end": 187,
"ctxt": 0
},
"value": "Obj1type",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 188,
"end": 213,
"ctxt": 0
},
"body": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 191,
"end": 211,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 195,
"end": 204,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 196,
"end": 204,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 198,
"end": 204,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 205,
"end": 210,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 207,
"end": 210,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 214,
"end": 233,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 218,
"end": 232,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 218,
"end": 222,
"ctxt": 0
},
"value": "Obj1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 222,
"end": 232,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 224,
"end": 232,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 224,
"end": 232,
"ctxt": 0
},
"value": "Obj1type",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 234,
"end": 250,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 234,
"end": 249,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 235,
"end": 239,
"ctxt": 0
},
"value": "Obj1",
"optional": false
},
"span": {
"start": 234,
"end": 249,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 240,
"end": 246,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 242,
"end": 246,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 243,
"end": 245,
"ctxt": 0
},
"value": 10.0
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 258,
"end": 322,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 268,
"end": 276,
"ctxt": 0
},
"value": "Obj2type",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 277,
"end": 322,
"ctxt": 0
},
"body": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 280,
"end": 320,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 284,
"end": 293,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 285,
"end": 293,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 287,
"end": 293,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 294,
"end": 319,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 296,
"end": 319,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 298,
"end": 309,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"value": "q",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 300,
"end": 308,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 302,
"end": 308,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 310,
"end": 317,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 310,
"end": 312,
"ctxt": 0
},
"value": "pr",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 312,
"end": 317,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 314,
"end": 317,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 323,
"end": 342,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 327,
"end": 341,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 327,
"end": 331,
"ctxt": 0
},
"value": "Obj2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 331,
"end": 341,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 333,
"end": 341,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 333,
"end": 341,
"ctxt": 0
},
"value": "Obj2type",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 343,
"end": 359,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 343,
"end": 358,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 344,
"end": 348,
"ctxt": 0
},
"value": "Obj2",
"optional": false
},
"span": {
"start": 343,
"end": 358,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 349,
"end": 355,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 349,
"end": 350,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 351,
"end": 355,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 352,
"end": 354,
"ctxt": 0
},
"value": 10.0
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 367,
"end": 422,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 377,
"end": 385,
"ctxt": 0
},
"value": "Obj3type",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 386,
"end": 422,
"ctxt": 0
},
"body": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 389,
"end": 420,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 393,
"end": 402,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 394,
"end": 402,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 396,
"end": 402,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 403,
"end": 419,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 405,
"end": 419,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 407,
"end": 417,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 407,
"end": 408,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 408,
"end": 416,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 410,
"end": 416,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 423,
"end": 442,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 427,
"end": 441,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 427,
"end": 431,
"ctxt": 0
},
"value": "Obj3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 431,
"end": 441,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 433,
"end": 441,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 433,
"end": 441,
"ctxt": 0
},
"value": "Obj3type",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 443,
"end": 459,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 443,
"end": 458,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 444,
"end": 448,
"ctxt": 0
},
"value": "Obj3",
"optional": false
},
"span": {
"start": 443,
"end": 458,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 449,
"end": 455,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 449,
"end": 450,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 451,
"end": 455,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 452,
"end": 454,
"ctxt": 0
},
"value": 10.0
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 469,
"end": 489,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 473,
"end": 488,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 473,
"end": 483,
"ctxt": 0
},
"value": "attributes",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 483,
"end": 488,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 485,
"end": 488,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 490,
"end": 515,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 490,
"end": 514,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 491,
"end": 495,
"ctxt": 0
},
"value": "Obj3",
"optional": false
},
"span": {
"start": 490,
"end": 514,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 497,
"end": 500,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 500,
"end": 510,
"ctxt": 0
},
"value": "attributes",
"optional": false
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 525,
"end": 542,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 525,
"end": 541,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 526,
"end": 530,
"ctxt": 0
},
"value": "Obj3",
"optional": false
},
"span": {
"start": 525,
"end": 541,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 532,
"end": 535,
"ctxt": 0
},
"arguments": {
"type": "ObjectExpression",
"span": {
"start": 535,
"end": 537,
"ctxt": 0
},
"properties": []
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 550,
"end": 624,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 560,
"end": 568,
"ctxt": 0
},
"value": "Obj4type",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 569,
"end": 624,
"ctxt": 0
},
"body": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 572,
"end": 622,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 576,
"end": 585,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 577,
"end": 585,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 579,
"end": 585,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 586,
"end": 621,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 588,
"end": 621,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 590,
"end": 600,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 590,
"end": 591,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 591,
"end": 599,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 593,
"end": 599,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 601,
"end": 619,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 601,
"end": 603,
"ctxt": 0
},
"value": "pr",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 603,
"end": 619,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 605,
"end": 619,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 607,
"end": 617,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 607,
"end": 608,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 608,
"end": 616,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 610,
"end": 616,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 625,
"end": 644,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 629,
"end": 643,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 629,
"end": 633,
"ctxt": 0
},
"value": "Obj4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 633,
"end": 643,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 635,
"end": 643,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 635,
"end": 643,
"ctxt": 0
},
"value": "Obj4type",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 645,
"end": 661,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 645,
"end": 660,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 646,
"end": 650,
"ctxt": 0
},
"value": "Obj4",
"optional": false
},
"span": {
"start": 645,
"end": 660,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 651,
"end": 657,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 651,
"end": 652,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 653,
"end": 657,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 654,
"end": 656,
"ctxt": 0
},
"value": 10.0
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 668,
"end": 686,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 668,
"end": 685,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 669,
"end": 673,
"ctxt": 0
},
"value": "Obj4",
"optional": false
},
"span": {
"start": 668,
"end": 685,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 674,
"end": 682,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 674,
"end": 675,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 676,
"end": 682,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 677,
"end": 681,
"ctxt": 0
},
"value": "10",
"raw": "'10'"
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
}
],
"interpreter": null
}