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

742 lines
18 KiB
JSON

{
"type": "Module",
"span": {
"start": 115,
"end": 591,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 115,
"end": 147,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 122,
"end": 127,
"ctxt": 0
},
"value": "React",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 130,
"end": 146,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 138,
"end": 145,
"ctxt": 0
},
"value": "react",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 149,
"end": 207,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 159,
"end": 166,
"ctxt": 0
},
"value": "Address",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 167,
"end": 207,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 171,
"end": 186,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 171,
"end": 177,
"ctxt": 0
},
"value": "street",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 177,
"end": 185,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 179,
"end": 185,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 189,
"end": 205,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 189,
"end": 196,
"ctxt": 0
},
"value": "country",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 196,
"end": 204,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 198,
"end": 204,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 209,
"end": 278,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 219,
"end": 234,
"ctxt": 0
},
"value": "CanadianAddress",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 243,
"end": 250,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 243,
"end": 250,
"ctxt": 0
},
"value": "Address",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 251,
"end": 278,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 257,
"end": 276,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 257,
"end": 267,
"ctxt": 0
},
"value": "postalCode",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 267,
"end": 275,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 269,
"end": 275,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 280,
"end": 346,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 290,
"end": 305,
"ctxt": 0
},
"value": "AmericanAddress",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 314,
"end": 321,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 314,
"end": 321,
"ctxt": 0
},
"value": "Address",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 322,
"end": 346,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 328,
"end": 344,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 328,
"end": 335,
"ctxt": 0
},
"value": "zipCode",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 335,
"end": 343,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 337,
"end": 343,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 348,
"end": 400,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 353,
"end": 363,
"ctxt": 0
},
"value": "Properties",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 366,
"end": 399,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 366,
"end": 381,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 366,
"end": 381,
"ctxt": 0
},
"value": "CanadianAddress",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 384,
"end": 399,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 384,
"end": 399,
"ctxt": 0
},
"value": "AmericanAddress",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 402,
"end": 513,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 415,
"end": 426,
"ctxt": 0
},
"value": "AddressComp",
"optional": false
},
"declare": false,
"span": {
"start": 409,
"end": 513,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 473,
"end": 511,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 480,
"end": 486,
"ctxt": 0
},
"value": "render",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 473,
"end": 511,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 489,
"end": 511,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 495,
"end": 507,
"ctxt": 0
},
"argument": {
"type": "NullLiteral",
"span": {
"start": 502,
"end": 506,
"ctxt": 0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "MemberExpression",
"span": {
"start": 435,
"end": 450,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 435,
"end": 440,
"ctxt": 0
},
"value": "React",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 441,
"end": 450,
"ctxt": 0
},
"value": "Component",
"optional": false
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 450,
"end": 468,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 451,
"end": 461,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 451,
"end": 461,
"ctxt": 0
},
"value": "Properties",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 463,
"end": 467,
"ctxt": 0
},
"kind": "void"
}
]
},
"implements": []
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 515,
"end": 591,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 519,
"end": 591,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 519,
"end": 520,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 523,
"end": 591,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 524,
"end": 535,
"ctxt": 0
},
"value": "AddressComp",
"optional": false
},
"span": {
"start": 523,
"end": 591,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 536,
"end": 556,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 536,
"end": 546,
"ctxt": 0
},
"value": "postalCode",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 547,
"end": 556,
"ctxt": 0
},
"value": "T1B 0L3",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "JSXAttribute",
"span": {
"start": 557,
"end": 575,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 557,
"end": 563,
"ctxt": 0
},
"value": "street",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 564,
"end": 575,
"ctxt": 0
},
"value": "vancouver",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "JSXAttribute",
"span": {
"start": 576,
"end": 588,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 576,
"end": 583,
"ctxt": 0
},
"value": "country",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 584,
"end": 588,
"ctxt": 0
},
"value": "CA",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
}
],
"interpreter": null
}