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

1311 lines
36 KiB
JSON

{
"type": "Script",
"span": {
"start": 62,
"end": 549,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 62,
"end": 227,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"value": "JSX",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 81,
"end": 227,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 84,
"end": 105,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 101,
"ctxt": 0
},
"value": "Element",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 102,
"end": 105,
"ctxt": 0
},
"body": []
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 107,
"end": 156,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 117,
"end": 142,
"ctxt": 0
},
"value": "ElementAttributesProperty",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 143,
"end": 156,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 145,
"end": 154,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 145,
"end": 150,
"ctxt": 0
},
"value": "props",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 150,
"end": 154,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 152,
"end": 154,
"ctxt": 0
},
"members": []
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 158,
"end": 225,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 168,
"end": 185,
"ctxt": 0
},
"value": "IntrinsicElements",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 186,
"end": 225,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 191,
"end": 200,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 191,
"end": 194,
"ctxt": 0
},
"value": "div",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 194,
"end": 199,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 196,
"end": 199,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 203,
"end": 211,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 203,
"end": 205,
"ctxt": 0
},
"value": "h2",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"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": "TsPropertySignature",
"span": {
"start": 214,
"end": 222,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 214,
"end": 216,
"ctxt": 0
},
"value": "h1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 216,
"end": 221,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 218,
"end": 221,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
}
]
}
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 235,
"end": 241,
"ctxt": 0
},
"value": "Button",
"optional": false
},
"declare": false,
"span": {
"start": 229,
"end": 315,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 245,
"end": 254,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 245,
"end": 250,
"ctxt": 0
},
"value": "props",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 250,
"end": 254,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 252,
"end": 254,
"ctxt": 0
},
"members": []
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 259,
"end": 313,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 259,
"end": 265,
"ctxt": 0
},
"value": "render",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 259,
"end": 313,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 268,
"end": 313,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 278,
"end": 307,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 285,
"end": 307,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 286,
"end": 306,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 287,
"end": 290,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 286,
"end": 291,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 291,
"end": 300,
"ctxt": 0
},
"value": "My Button",
"raw": "My Button"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 300,
"end": 306,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 302,
"end": 305,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 323,
"end": 378,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 327,
"end": 377,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 327,
"end": 329,
"ctxt": 0
},
"value": "k1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 332,
"end": 377,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 333,
"end": 336,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 332,
"end": 337,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 337,
"end": 338,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXElement",
"span": {
"start": 338,
"end": 354,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 339,
"end": 341,
"ctxt": 0
},
"value": "h2",
"optional": false
},
"span": {
"start": 338,
"end": 342,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 342,
"end": 349,
"ctxt": 0
},
"value": " Hello ",
"raw": " Hello "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 349,
"end": 354,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 351,
"end": 353,
"ctxt": 0
},
"value": "h2",
"optional": false
}
}
},
{
"type": "JSXText",
"span": {
"start": 354,
"end": 355,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXElement",
"span": {
"start": 355,
"end": 371,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 356,
"end": 358,
"ctxt": 0
},
"value": "h1",
"optional": false
},
"span": {
"start": 355,
"end": 359,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 359,
"end": 366,
"ctxt": 0
},
"value": " world ",
"raw": " world "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 366,
"end": 371,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 368,
"end": 370,
"ctxt": 0
},
"value": "h1",
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 371,
"end": 377,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 373,
"end": 376,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 379,
"end": 455,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 383,
"end": 454,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 383,
"end": 385,
"ctxt": 0
},
"value": "k2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 388,
"end": 454,
"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": 394,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXElement",
"span": {
"start": 394,
"end": 410,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 395,
"end": 397,
"ctxt": 0
},
"value": "h2",
"optional": false
},
"span": {
"start": 394,
"end": 398,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 398,
"end": 405,
"ctxt": 0
},
"value": " Hello ",
"raw": " Hello "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 405,
"end": 410,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 407,
"end": 409,
"ctxt": 0
},
"value": "h2",
"optional": false
}
}
},
{
"type": "JSXText",
"span": {
"start": 410,
"end": 411,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXExpressionContainer",
"span": {
"start": 411,
"end": 448,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 412,
"end": 447,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 413,
"end": 422,
"ctxt": 0
},
"value": "user",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 417,
"end": 422,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 419,
"end": 422,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"body": {
"type": "JSXElement",
"span": {
"start": 427,
"end": 447,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 428,
"end": 430,
"ctxt": 0
},
"value": "h2",
"optional": false
},
"span": {
"start": 427,
"end": 431,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXExpressionContainer",
"span": {
"start": 431,
"end": 442,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 432,
"end": 441,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 432,
"end": 436,
"ctxt": 0
},
"value": "user",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 437,
"end": 441,
"ctxt": 0
},
"value": "name",
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 442,
"end": 447,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 444,
"end": 446,
"ctxt": 0
},
"value": "h2",
"optional": false
}
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 448,
"end": 454,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 450,
"end": 453,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 456,
"end": 503,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 460,
"end": 502,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 460,
"end": 462,
"ctxt": 0
},
"value": "k3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 465,
"end": 502,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 466,
"end": 469,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 465,
"end": 470,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXExpressionContainer",
"span": {
"start": 471,
"end": 474,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "JSXText",
"span": {
"start": 474,
"end": 475,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXExpressionContainer",
"span": {
"start": 475,
"end": 495,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 476,
"end": 494,
"ctxt": 0
},
"value": "That is a number",
"raw": "\"That is a number\""
}
},
{
"type": "JSXText",
"span": {
"start": 495,
"end": 496,
"ctxt": 0
},
"value": " ",
"raw": " "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 496,
"end": 502,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 498,
"end": 501,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 504,
"end": 549,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 508,
"end": 548,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 508,
"end": 510,
"ctxt": 0
},
"value": "k4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 513,
"end": 548,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 514,
"end": 520,
"ctxt": 0
},
"value": "Button",
"optional": false
},
"span": {
"start": 513,
"end": 521,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 521,
"end": 522,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXElement",
"span": {
"start": 522,
"end": 538,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 523,
"end": 525,
"ctxt": 0
},
"value": "h2",
"optional": false
},
"span": {
"start": 522,
"end": 526,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 526,
"end": 533,
"ctxt": 0
},
"value": " Hello ",
"raw": " Hello "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 533,
"end": 538,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 535,
"end": 537,
"ctxt": 0
},
"value": "h2",
"optional": false
}
}
},
{
"type": "JSXText",
"span": {
"start": 538,
"end": 539,
"ctxt": 0
},
"value": " ",
"raw": " "
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 539,
"end": 548,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 541,
"end": 547,
"ctxt": 0
},
"value": "Button",
"optional": false
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}