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

629 lines
17 KiB
JSON

{
"type": "Script",
"span": {
"start": 39,
"end": 315,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 39,
"end": 137,
"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": 137,
"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": 135,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 111,
"ctxt": 0
},
"value": "IntrinsicElements",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 112,
"end": 135,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 116,
"end": 132,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 116,
"end": 121,
"ctxt": 0
},
"value": "test1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 121,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 123,
"end": 131,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 123,
"end": 131,
"ctxt": 0
},
"value": "Attribs1",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 138,
"end": 187,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 148,
"end": 156,
"ctxt": 0
},
"value": "Attribs1",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 157,
"end": 187,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 160,
"end": 185,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 160,
"end": 162,
"ctxt": 0
},
"value": "c1",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 163,
"end": 184,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 165,
"end": 184,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 166,
"end": 175,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 167,
"end": 175,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 169,
"end": 175,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 177,
"end": 184,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 180,
"end": 184,
"ctxt": 0
},
"kind": "void"
}
}
}
},
"typeParams": null
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 195,
"end": 226,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 195,
"end": 225,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 196,
"end": 201,
"ctxt": 0
},
"value": "test1",
"optional": false
},
"span": {
"start": 195,
"end": 225,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 202,
"end": 222,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 202,
"end": 204,
"ctxt": 0
},
"value": "c1",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 205,
"end": 222,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 206,
"end": 221,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 207,
"end": 208,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 213,
"end": 221,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 215,
"end": 221,
"ctxt": 0
},
"value": "length",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 233,
"end": 267,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 233,
"end": 266,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 234,
"end": 239,
"ctxt": 0
},
"value": "test1",
"optional": false
},
"span": {
"start": 233,
"end": 266,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 240,
"end": 263,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 240,
"end": 247,
"ctxt": 0
},
"value": "data-c1",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 248,
"end": 263,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 249,
"end": 262,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 256,
"end": 262,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 256,
"end": 257,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 258,
"end": 262,
"ctxt": 0
},
"value": "leng",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 286,
"end": 315,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 286,
"end": 314,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 287,
"end": 292,
"ctxt": 0
},
"value": "test1",
"optional": false
},
"span": {
"start": 286,
"end": 314,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 293,
"end": 311,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 293,
"end": 295,
"ctxt": 0
},
"value": "c1",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 296,
"end": 311,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 297,
"end": 310,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 304,
"end": 310,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 304,
"end": 305,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 306,
"end": 310,
"ctxt": 0
},
"value": "leng",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
}
],
"interpreter": null
}