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

973 lines
29 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 294,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 42,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 41,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 10,
"ctxt": 0
},
"value": "union",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 10,
"end": 41,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 12,
"end": 41,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 12,
"end": 25,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 14,
"end": 23,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 15,
"end": 23,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 17,
"end": 23,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 28,
"end": 41,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 30,
"end": 39,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 31,
"end": 39,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 33,
"end": 39,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 44,
"end": 82,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 48,
"end": 81,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"value": "o3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 50,
"end": 81,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 52,
"end": 81,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 52,
"end": 65,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 54,
"end": 63,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 55,
"end": 63,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 57,
"end": 63,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 68,
"end": 81,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 70,
"end": 79,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 71,
"end": 79,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 73,
"end": 79,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 83,
"end": 106,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 87,
"end": 105,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 87,
"end": 89,
"ctxt": 0
},
"value": "o3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 93,
"end": 105,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
"start": 95,
"end": 98,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 98,
"end": 103,
"ctxt": 0
},
"value": "union",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 108,
"end": 159,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 112,
"end": 158,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 112,
"end": 114,
"ctxt": 0
},
"value": "o4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 114,
"end": 158,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 116,
"end": 158,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 116,
"end": 130,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 118,
"end": 128,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 119,
"end": 128,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 121,
"end": 128,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 133,
"end": 158,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 135,
"end": 146,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 136,
"end": 144,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 138,
"end": 144,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 147,
"end": 157,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 148,
"end": 157,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 150,
"end": 157,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 160,
"end": 193,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 164,
"end": 192,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 164,
"end": 166,
"ctxt": 0
},
"value": "o4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 170,
"end": 192,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
"start": 172,
"end": 175,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 175,
"end": 180,
"ctxt": 0
},
"value": "union",
"optional": false
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 185,
"end": 190,
"ctxt": 0
},
"value": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 195,
"end": 260,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 199,
"end": 259,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 199,
"end": 201,
"ctxt": 0
},
"value": "o5",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 201,
"end": 259,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 203,
"end": 259,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 203,
"end": 216,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 205,
"end": 214,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 205,
"end": 206,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 206,
"end": 214,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 208,
"end": 214,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 219,
"end": 232,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 221,
"end": 230,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 222,
"end": 230,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 224,
"end": 230,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 235,
"end": 259,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 237,
"end": 247,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 238,
"end": 246,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 240,
"end": 246,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 248,
"end": 257,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 248,
"end": 249,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 249,
"end": 257,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 251,
"end": 257,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 261,
"end": 294,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 265,
"end": 293,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 265,
"end": 267,
"ctxt": 0
},
"value": "o5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 271,
"end": 293,
"ctxt": 0
},
"properties": [
{
"type": "SpreadElement",
"spread": {
"start": 273,
"end": 276,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 276,
"end": 281,
"ctxt": 0
},
"value": "union",
"optional": false
}
},
{
"type": "SpreadElement",
"spread": {
"start": 283,
"end": 286,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 286,
"end": 291,
"ctxt": 0
},
"value": "union",
"optional": false
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}