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

1506 lines
40 KiB
JSON

{
"type": "Module",
"span": {
"start": 132,
"end": 649,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 132,
"end": 164,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 139,
"end": 144,
"ctxt": 0
},
"value": "React",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 147,
"end": 163,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 155,
"end": 162,
"ctxt": 0
},
"value": "react",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 166,
"end": 247,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 176,
"end": 181,
"ctxt": 0
},
"value": "Props",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 182,
"end": 247,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 188,
"end": 198,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 189,
"end": 197,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 191,
"end": 197,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 203,
"end": 213,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 203,
"end": 204,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 204,
"end": 212,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 218,
"end": 229,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 218,
"end": 219,
"ctxt": 0
},
"value": "c",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 220,
"end": 228,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 222,
"end": 228,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 234,
"end": 245,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 234,
"end": 235,
"ctxt": 0
},
"value": "d",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 236,
"end": 244,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 238,
"end": 244,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 250,
"end": 286,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 256,
"end": 285,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 256,
"end": 261,
"ctxt": 0
},
"value": "props",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 261,
"end": 268,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 263,
"end": 268,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 263,
"end": 268,
"ctxt": 0
},
"value": "Props",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 271,
"end": 285,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 273,
"end": 274,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 279,
"end": 280,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 287,
"end": 340,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 293,
"end": 339,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 293,
"end": 296,
"ctxt": 0
},
"value": "Foo",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 299,
"end": 339,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 300,
"end": 312,
"ctxt": 0
},
"value": "props",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 305,
"end": 312,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 307,
"end": 312,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 307,
"end": 312,
"ctxt": 0
},
"value": "Props",
"optional": false
},
"typeParams": null
}
}
}
],
"body": {
"type": "JSXElement",
"span": {
"start": 317,
"end": 339,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 318,
"end": 321,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 317,
"end": 322,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXExpressionContainer",
"span": {
"start": 322,
"end": 333,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 324,
"end": 331,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 324,
"end": 329,
"ctxt": 0
},
"value": "props",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 333,
"end": 339,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 335,
"end": 338,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 348,
"end": 382,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 354,
"end": 381,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 354,
"end": 356,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 359,
"end": 381,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 360,
"end": 363,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 359,
"end": 375,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 365,
"end": 368,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 368,
"end": 373,
"ctxt": 0
},
"value": "props",
"optional": false
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 375,
"end": 381,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 377,
"end": 380,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 383,
"end": 423,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 389,
"end": 422,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 389,
"end": 391,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 394,
"end": 422,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 395,
"end": 398,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 394,
"end": 416,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 399,
"end": 404,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 399,
"end": 400,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 401,
"end": 404,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 402,
"end": 403,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "SpreadElement",
"spread": {
"start": 406,
"end": 409,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 409,
"end": 414,
"ctxt": 0
},
"value": "props",
"optional": false
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 416,
"end": 422,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 418,
"end": 421,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 434,
"end": 474,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 440,
"end": 473,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 440,
"end": 442,
"ctxt": 0
},
"value": "b1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 445,
"end": 473,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 446,
"end": 449,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 445,
"end": 467,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 450,
"end": 455,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 450,
"end": 451,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 452,
"end": 455,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 453,
"end": 454,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "SpreadElement",
"spread": {
"start": 457,
"end": 460,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 460,
"end": 465,
"ctxt": 0
},
"value": "props",
"optional": false
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 467,
"end": 473,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 469,
"end": 472,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 475,
"end": 521,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 481,
"end": 520,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 481,
"end": 483,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 486,
"end": 520,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 487,
"end": 490,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 486,
"end": 514,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 491,
"end": 496,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 491,
"end": 492,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 493,
"end": 496,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "JSXAttribute",
"span": {
"start": 497,
"end": 502,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 497,
"end": 498,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 499,
"end": 502,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 500,
"end": 501,
"ctxt": 0
},
"value": 2.0
}
}
},
{
"type": "SpreadElement",
"spread": {
"start": 504,
"end": 507,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 507,
"end": 512,
"ctxt": 0
},
"value": "props",
"optional": false
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 514,
"end": 520,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 516,
"end": 519,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 522,
"end": 582,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 528,
"end": 581,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 528,
"end": 530,
"ctxt": 0
},
"value": "b3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 533,
"end": 581,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 534,
"end": 537,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 533,
"end": 575,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 538,
"end": 543,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 538,
"end": 539,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 540,
"end": 543,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 541,
"end": 542,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "JSXAttribute",
"span": {
"start": 544,
"end": 549,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 544,
"end": 545,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 546,
"end": 549,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 547,
"end": 548,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "SpreadElement",
"spread": {
"start": 551,
"end": 554,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 554,
"end": 559,
"ctxt": 0
},
"value": "props",
"optional": false
}
},
{
"type": "SpreadElement",
"spread": {
"start": 562,
"end": 565,
"ctxt": 0
},
"arguments": {
"type": "ObjectExpression",
"span": {
"start": 565,
"end": 573,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 567,
"end": 568,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 570,
"end": 571,
"ctxt": 0
},
"value": 1.0
}
}
]
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 575,
"end": 581,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 577,
"end": 580,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 583,
"end": 649,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 589,
"end": 648,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 589,
"end": 591,
"ctxt": 0
},
"value": "b4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 594,
"end": 648,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 595,
"end": 598,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 594,
"end": 642,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 599,
"end": 604,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 599,
"end": 600,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 601,
"end": 604,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 602,
"end": 603,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "JSXAttribute",
"span": {
"start": 605,
"end": 610,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 605,
"end": 606,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 607,
"end": 610,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 608,
"end": 609,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "SpreadElement",
"spread": {
"start": 612,
"end": 615,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 615,
"end": 620,
"ctxt": 0
},
"value": "props",
"optional": false
}
},
{
"type": "SpreadElement",
"spread": {
"start": 623,
"end": 626,
"ctxt": 0
},
"arguments": {
"type": "ObjectExpression",
"span": {
"start": 626,
"end": 640,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 628,
"end": 629,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 631,
"end": 632,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 634,
"end": 635,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 637,
"end": 638,
"ctxt": 0
},
"value": 1.0
}
}
]
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 642,
"end": 648,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 644,
"end": 647,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}