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

1349 lines
36 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 115,
"end": 768,
"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",
"raw": "'react'"
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 149,
"end": 200,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 159,
"end": 171,
"ctxt": 0
},
"value": "PoisonedProp",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 172,
"end": 200,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 178,
"end": 188,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 178,
"end": 179,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 179,
"end": 187,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 181,
"end": 187,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 193,
"end": 198,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 194,
"end": 197,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"literal": {
"type": "NumericLiteral",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": 2.0
}
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 208,
"end": 216,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"declare": false,
"span": {
"start": 202,
"end": 316,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 265,
"end": 314,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 265,
"end": 271,
"ctxt": 0
},
"value": "render",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 265,
"end": 314,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 274,
"end": 314,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 284,
"end": 308,
"ctxt": 0
},
"argument": {
"type": "JSXElement",
"span": {
"start": 291,
"end": 307,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 292,
"end": 295,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 291,
"end": 296,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 296,
"end": 301,
"ctxt": 0
},
"value": "Hello",
"raw": "Hello"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 301,
"end": 307,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 303,
"end": 306,
"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": 225,
"end": 240,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 225,
"end": 230,
"ctxt": 0
},
"value": "React",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 231,
"end": 240,
"ctxt": 0
},
"value": "Component",
"optional": false
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 240,
"end": 258,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 241,
"end": 253,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 241,
"end": 253,
"ctxt": 0
},
"value": "PoisonedProp",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeLiteral",
"span": {
"start": 255,
"end": 257,
"ctxt": 0
},
"members": []
}
]
},
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 318,
"end": 379,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 324,
"end": 378,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 324,
"end": 327,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 327,
"end": 341,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 329,
"end": 341,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 329,
"end": 341,
"ctxt": 0
},
"value": "PoisonedProp",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 344,
"end": 378,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 350,
"end": 351,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 353,
"end": 366,
"ctxt": 0
},
"value": "hello world",
"raw": "\"hello world\""
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 372,
"end": 373,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 375,
"end": 376,
"ctxt": 0
},
"value": 2.0
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 387,
"end": 417,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 391,
"end": 416,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 391,
"end": 392,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 395,
"end": 416,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 396,
"end": 404,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"span": {
"start": 395,
"end": 416,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 406,
"end": 409,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 409,
"end": 412,
"ctxt": 0
},
"value": "obj",
"optional": false
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 425,
"end": 434,
"ctxt": 0
},
"value": "EmptyProp",
"optional": false
},
"declare": false,
"span": {
"start": 419,
"end": 529,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 473,
"end": 527,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 473,
"end": 479,
"ctxt": 0
},
"value": "render",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 473,
"end": 527,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 482,
"end": 527,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 492,
"end": 521,
"ctxt": 0
},
"argument": {
"type": "JSXElement",
"span": {
"start": 499,
"end": 520,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 500,
"end": 503,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 499,
"end": 504,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 504,
"end": 514,
"ctxt": 0
},
"value": "Default hi",
"raw": "Default hi"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 514,
"end": 520,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 516,
"end": 519,
"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": 443,
"end": 458,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 443,
"end": 448,
"ctxt": 0
},
"value": "React",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 449,
"end": 458,
"ctxt": 0
},
"value": "Component",
"optional": false
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 458,
"end": 466,
"ctxt": 0
},
"params": [
{
"type": "TsTypeLiteral",
"span": {
"start": 459,
"end": 461,
"ctxt": 0
},
"members": []
},
{
"type": "TsTypeLiteral",
"span": {
"start": 463,
"end": 465,
"ctxt": 0
},
"members": []
}
]
},
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 537,
"end": 548,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 541,
"end": 547,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 541,
"end": 542,
"ctxt": 0
},
"value": "j",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 542,
"end": 547,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 544,
"end": 547,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 549,
"end": 580,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 553,
"end": 579,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 553,
"end": 555,
"ctxt": 0
},
"value": "e1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 558,
"end": 579,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 559,
"end": 568,
"ctxt": 0
},
"value": "EmptyProp",
"optional": false
},
"span": {
"start": 558,
"end": 579,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 570,
"end": 573,
"ctxt": 0
},
"arguments": {
"type": "ObjectExpression",
"span": {
"start": 573,
"end": 575,
"ctxt": 0
},
"properties": []
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 581,
"end": 610,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 585,
"end": 610,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 585,
"end": 587,
"ctxt": 0
},
"value": "e2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 590,
"end": 610,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 591,
"end": 600,
"ctxt": 0
},
"value": "EmptyProp",
"optional": false
},
"span": {
"start": 590,
"end": 610,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 602,
"end": 605,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 605,
"end": 606,
"ctxt": 0
},
"value": "j",
"optional": false
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 611,
"end": 686,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 615,
"end": 686,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 615,
"end": 617,
"ctxt": 0
},
"value": "e3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 620,
"end": 686,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 621,
"end": 630,
"ctxt": 0
},
"value": "EmptyProp",
"optional": false
},
"span": {
"start": 620,
"end": 686,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 632,
"end": 635,
"ctxt": 0
},
"arguments": {
"type": "ObjectExpression",
"span": {
"start": 635,
"end": 682,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 637,
"end": 640,
"ctxt": 0
},
"value": "ref",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 642,
"end": 680,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 643,
"end": 648,
"ctxt": 0
},
"value": "input",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 653,
"end": 680,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 655,
"end": 678,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 655,
"end": 677,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 655,
"end": 669,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 655,
"end": 659,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 660,
"end": 669,
"ctxt": 0
},
"value": "textInput",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 672,
"end": 677,
"ctxt": 0
},
"value": "input",
"optional": false
}
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 687,
"end": 719,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 691,
"end": 719,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 691,
"end": 693,
"ctxt": 0
},
"value": "e4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 696,
"end": 719,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 697,
"end": 706,
"ctxt": 0
},
"value": "EmptyProp",
"optional": false
},
"span": {
"start": 696,
"end": 719,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 707,
"end": 716,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 707,
"end": 716,
"ctxt": 0
},
"value": "data-prop",
"optional": false
},
"value": null
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 720,
"end": 768,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 724,
"end": 768,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 724,
"end": 726,
"ctxt": 0
},
"value": "e5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 729,
"end": 768,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 730,
"end": 739,
"ctxt": 0
},
"value": "EmptyProp",
"optional": false
},
"span": {
"start": 729,
"end": 768,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 741,
"end": 744,
"ctxt": 0
},
"arguments": {
"type": "ObjectExpression",
"span": {
"start": 744,
"end": 764,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "StringLiteral",
"span": {
"start": 746,
"end": 757,
"ctxt": 0
},
"value": "data-prop",
"raw": "\"data-prop\""
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 759,
"end": 763,
"ctxt": 0
},
"value": true
}
}
]
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
}
],
"interpreter": null
}