swc/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution2x.json

423 lines
10 KiB
JSON

{
"type": "Module",
"span": {
"start": 115,
"end": 317,
"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": 180,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"value": "Prop",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 164,
"end": 180,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 170,
"end": 178,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 171,
"end": 177,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 173,
"end": 177,
"ctxt": 0
},
"literal": {
"type": "BooleanLiteral",
"span": {
"start": 173,
"end": 177,
"ctxt": 0
},
"value": true
}
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 187,
"end": 195,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"declare": false,
"span": {
"start": 181,
"end": 287,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 236,
"end": 285,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 236,
"end": 242,
"ctxt": 0
},
"value": "render",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 236,
"end": 285,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 245,
"end": 285,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 255,
"end": 279,
"ctxt": 0
},
"argument": {
"type": "JSXElement",
"span": {
"start": 262,
"end": 278,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 263,
"end": 266,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 262,
"end": 267,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 267,
"end": 272,
"ctxt": 0
},
"value": "Hello",
"raw": "Hello"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 272,
"end": 278,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 274,
"end": 277,
"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": {
"type": "MemberExpression",
"span": {
"start": 204,
"end": 219,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 204,
"end": 209,
"ctxt": 0
},
"value": "React",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 210,
"end": 219,
"ctxt": 0
},
"value": "Component",
"optional": false
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 219,
"end": 229,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 220,
"end": 224,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 220,
"end": 224,
"ctxt": 0
},
"value": "Prop",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeLiteral",
"span": {
"start": 226,
"end": 228,
"ctxt": 0
},
"members": []
}
]
},
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 295,
"end": 317,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 299,
"end": 316,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 299,
"end": 300,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 303,
"end": 316,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 304,
"end": 312,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"span": {
"start": 303,
"end": 316,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 313,
"end": 314,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 313,
"end": 314,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
}
],
"interpreter": null
}