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

1080 lines
28 KiB
JSON

{
"type": "Module",
"span": {
"start": 115,
"end": 558,
"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": 202,
"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": 202,
"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": 200,
"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": 199,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 196,
"end": 199,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 196,
"end": 199,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"typeParams": null
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 210,
"end": 218,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"declare": false,
"span": {
"start": 204,
"end": 318,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 267,
"end": 316,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 267,
"end": 273,
"ctxt": 0
},
"value": "render",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 267,
"end": 316,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 276,
"end": 316,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 286,
"end": 310,
"ctxt": 0
},
"argument": {
"type": "JSXElement",
"span": {
"start": 293,
"end": 309,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 294,
"end": 297,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 293,
"end": 298,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 298,
"end": 303,
"ctxt": 0
},
"value": "Hello",
"raw": "Hello"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 303,
"end": 309,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 305,
"end": 308,
"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": 227,
"end": 242,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 227,
"end": 232,
"ctxt": 0
},
"value": "React",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 233,
"end": 242,
"ctxt": 0
},
"value": "Component",
"optional": false
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 242,
"end": 260,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 243,
"end": 255,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 243,
"end": 255,
"ctxt": 0
},
"value": "PoisonedProp",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeLiteral",
"span": {
"start": 257,
"end": 259,
"ctxt": 0
},
"members": []
}
]
},
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 320,
"end": 335,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 326,
"end": 334,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 326,
"end": 329,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 332,
"end": 334,
"ctxt": 0
},
"properties": []
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 343,
"end": 379,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 343,
"end": 378,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 344,
"end": 352,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"span": {
"start": 343,
"end": 378,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 354,
"end": 357,
"ctxt": 0
},
"arguments": {
"type": "ObjectExpression",
"span": {
"start": 357,
"end": 374,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 361,
"end": 365,
"ctxt": 0
},
"value": "ok",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 370,
"end": 373,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 390,
"end": 420,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 394,
"end": 419,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 398,
"end": 419,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 399,
"end": 407,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"span": {
"start": 398,
"end": 419,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 409,
"end": 412,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 412,
"end": 415,
"ctxt": 0
},
"value": "obj",
"optional": false
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 421,
"end": 442,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 425,
"end": 441,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 425,
"end": 426,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 429,
"end": 441,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 430,
"end": 438,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"span": {
"start": 429,
"end": 441,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 443,
"end": 467,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 447,
"end": 466,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 447,
"end": 448,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 451,
"end": 466,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 452,
"end": 460,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"span": {
"start": 451,
"end": 466,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 461,
"end": 462,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 461,
"end": 462,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null
},
{
"type": "JSXAttribute",
"span": {
"start": 463,
"end": 464,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 463,
"end": 464,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": null
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 468,
"end": 508,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 472,
"end": 507,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"value": "w",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 476,
"end": 507,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 477,
"end": 485,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"span": {
"start": 476,
"end": 507,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 487,
"end": 490,
"ctxt": 0
},
"arguments": {
"type": "ObjectExpression",
"span": {
"start": 490,
"end": 504,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 491,
"end": 492,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": 5.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 497,
"end": 498,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 500,
"end": 503,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 509,
"end": 558,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 513,
"end": 557,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 513,
"end": 515,
"ctxt": 0
},
"value": "w1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 518,
"end": 557,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 519,
"end": 527,
"ctxt": 0
},
"value": "Poisoned",
"optional": false
},
"span": {
"start": 518,
"end": 557,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 529,
"end": 532,
"ctxt": 0
},
"arguments": {
"type": "ObjectExpression",
"span": {
"start": 532,
"end": 546,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 533,
"end": 534,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 536,
"end": 537,
"ctxt": 0
},
"value": 5.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 539,
"end": 540,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 542,
"end": 545,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
},
{
"type": "JSXAttribute",
"span": {
"start": 548,
"end": 554,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 548,
"end": 549,
"ctxt": 0
},
"value": "X",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 550,
"end": 554,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
}
],
"interpreter": null
}