swc/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty13.json
2022-02-04 17:08:38 +09:00

853 lines
24 KiB
JSON

{
"type": "Module",
"span": {
"start": 142,
"end": 663,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 142,
"end": 174,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 149,
"end": 154,
"ctxt": 0
},
"value": "React",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 157,
"end": 173,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 165,
"end": 172,
"ctxt": 0
},
"value": "react",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 176,
"end": 252,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 186,
"end": 196,
"ctxt": 0
},
"value": "ButtonProp",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 197,
"end": 252,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 203,
"end": 213,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 203,
"end": 204,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 204,
"end": 212,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 218,
"end": 228,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 218,
"end": 219,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 219,
"end": 227,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 221,
"end": 227,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 233,
"end": 250,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 233,
"end": 241,
"ctxt": 0
},
"value": "children",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 241,
"end": 249,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 243,
"end": 249,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 243,
"end": 249,
"ctxt": 0
},
"value": "Button",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 260,
"end": 266,
"ctxt": 0
},
"value": "Button",
"optional": false
},
"declare": false,
"span": {
"start": 254,
"end": 502,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 314,
"end": 500,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 314,
"end": 320,
"ctxt": 0
},
"value": "render",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 314,
"end": 500,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 323,
"end": 500,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 379,
"end": 494,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 386,
"end": 493,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 387,
"end": 492,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 388,
"end": 399,
"ctxt": 0
},
"value": "InnerButton",
"optional": false
},
"span": {
"start": 387,
"end": 430,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 401,
"end": 404,
"ctxt": 0
},
"arguments": {
"type": "MemberExpression",
"span": {
"start": 404,
"end": 414,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 404,
"end": 408,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 409,
"end": 414,
"ctxt": 0
},
"value": "props",
"optional": false
}
}
},
{
"type": "JSXAttribute",
"span": {
"start": 416,
"end": 429,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 416,
"end": 424,
"ctxt": 0
},
"value": "children",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 425,
"end": 429,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 430,
"end": 443,
"ctxt": 0
},
"value": "\n\n ",
"raw": "\n\n "
},
{
"type": "JSXElement",
"span": {
"start": 443,
"end": 465,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 444,
"end": 447,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 443,
"end": 448,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 448,
"end": 459,
"ctxt": 0
},
"value": "Hello World",
"raw": "Hello World"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 459,
"end": 465,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 461,
"end": 464,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
{
"type": "JSXText",
"span": {
"start": 465,
"end": 478,
"ctxt": 0
},
"value": "\n\n ",
"raw": "\n\n "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 478,
"end": 492,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 480,
"end": 491,
"ctxt": 0
},
"value": "InnerButton",
"optional": false
}
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "MemberExpression",
"span": {
"start": 275,
"end": 290,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 275,
"end": 280,
"ctxt": 0
},
"value": "React",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 281,
"end": 290,
"ctxt": 0
},
"value": "Component",
"optional": false
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 290,
"end": 307,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 291,
"end": 301,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 291,
"end": 301,
"ctxt": 0
},
"value": "ButtonProp",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 303,
"end": 306,
"ctxt": 0
},
"kind": "any"
}
]
},
"implements": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 504,
"end": 544,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 514,
"end": 529,
"ctxt": 0
},
"value": "InnerButtonProp",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 530,
"end": 544,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 533,
"end": 542,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 533,
"end": 534,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 534,
"end": 542,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 536,
"end": 542,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 552,
"end": 563,
"ctxt": 0
},
"value": "InnerButton",
"optional": false
},
"declare": false,
"span": {
"start": 546,
"end": 663,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 613,
"end": 661,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 613,
"end": 619,
"ctxt": 0
},
"value": "render",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 613,
"end": 661,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 622,
"end": 661,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 626,
"end": 658,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 633,
"end": 657,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 634,
"end": 656,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 635,
"end": 641,
"ctxt": 0
},
"value": "button",
"optional": false
},
"span": {
"start": 634,
"end": 642,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 642,
"end": 647,
"ctxt": 0
},
"value": "Hello",
"raw": "Hello"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 647,
"end": 656,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 649,
"end": 655,
"ctxt": 0
},
"value": "button",
"optional": false
}
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "MemberExpression",
"span": {
"start": 572,
"end": 587,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 572,
"end": 577,
"ctxt": 0
},
"value": "React",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 578,
"end": 587,
"ctxt": 0
},
"value": "Component",
"optional": false
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 587,
"end": 609,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 588,
"end": 603,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 588,
"end": 603,
"ctxt": 0
},
"value": "InnerButtonProp",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 605,
"end": 608,
"ctxt": 0
},
"kind": "any"
}
]
},
"implements": []
}
],
"interpreter": null
}