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

1402 lines
36 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 40,
"end": 481,
"ctxt": 0
},
"body": [
{
"type": "TsTypeAliasDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 40,
"end": 79,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 45,
"end": 48,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 48,
"end": 51,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 49,
"end": 50,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 49,
"end": 50,
"ctxt": 0
},
"value": "A",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 54,
"end": 78,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 56,
"end": 68,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 56,
"end": 60,
"ctxt": 0
},
"value": "type",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 60,
"end": 67,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 62,
"end": 67,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 62,
"end": 67,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
},
"typeParams": null
},
{
"type": "TsCallSignatureDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 69,
"end": 76,
"ctxt": 0
},
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 71,
"end": 76,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 73,
"end": 76,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 73,
"end": 74,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 80,
"end": 117,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 85,
"end": 88,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 88,
"end": 91,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 89,
"end": 90,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 89,
"end": 90,
"ctxt": 0
},
"value": "A",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 94,
"end": 116,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 96,
"end": 108,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 96,
"end": 100,
"ctxt": 0
},
"value": "type",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 100,
"end": 107,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 102,
"end": 107,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 102,
"end": 107,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
}
}
},
"typeParams": null
},
{
"type": "TsCallSignatureDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 109,
"end": 114,
"ctxt": 0
},
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 111,
"end": 114,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 113,
"end": 114,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 113,
"end": 114,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 119,
"end": 152,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 124,
"end": 130,
"ctxt": 0
},
"value": "FooBar",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 130,
"end": 133,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 131,
"end": 132,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "A",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 136,
"end": 151,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 136,
"end": 142,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 136,
"end": 139,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 139,
"end": 142,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 140,
"end": 141,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 140,
"end": 141,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 145,
"end": 151,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 145,
"end": 148,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 148,
"end": 151,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 149,
"end": 150,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 149,
"end": 150,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 154,
"end": 209,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 159,
"end": 165,
"ctxt": 0
},
"value": "InferA",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 165,
"end": 168,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 166,
"end": 167,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 166,
"end": 167,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsConditionalType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 171,
"end": 208,
"ctxt": 0
},
"checkType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 171,
"end": 172,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
"extendsType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 181,
"end": 196,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 181,
"end": 187,
"ctxt": 0
},
"value": "FooBar",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 187,
"end": 196,
"ctxt": 0
},
"params": [
{
"type": "TsInferType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 188,
"end": 195,
"ctxt": 0
},
"typeParam": {
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 194,
"end": 195,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 194,
"end": 195,
"ctxt": 0
},
"value": "A",
"optional": false
},
"constraint": null,
"default": null
}
}
]
}
},
"trueType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 199,
"end": 200,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 199,
"end": 200,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
},
"falseType": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 203,
"end": 208,
"ctxt": 0
},
"kind": "never"
}
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 211,
"end": 243,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 216,
"end": 220,
"ctxt": 0
},
"value": "FooA",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 223,
"end": 242,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 223,
"end": 229,
"ctxt": 0
},
"value": "InferA",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 229,
"end": 242,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 230,
"end": 241,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 230,
"end": 233,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 233,
"end": 241,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 234,
"end": 240,
"ctxt": 0
},
"kind": "number"
}
]
}
}
]
}
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 278,
"end": 343,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 283,
"end": 287,
"ctxt": 0
},
"value": "Item",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 287,
"end": 290,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 288,
"end": 289,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 288,
"end": 289,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 293,
"end": 342,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 293,
"end": 315,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 295,
"end": 305,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 295,
"end": 299,
"ctxt": 0
},
"value": "kind",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 299,
"end": 304,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 301,
"end": 304,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 301,
"end": 304,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 306,
"end": 313,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 306,
"end": 310,
"ctxt": 0
},
"value": "data",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 310,
"end": 313,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 312,
"end": 313,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 312,
"end": 313,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 318,
"end": 342,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 320,
"end": 330,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 320,
"end": 324,
"ctxt": 0
},
"value": "kind",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 324,
"end": 329,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 326,
"end": 329,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 326,
"end": 329,
"ctxt": 0
},
"value": "b",
"raw": "'b'"
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 331,
"end": 340,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 331,
"end": 335,
"ctxt": 0
},
"value": "data",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 335,
"end": 340,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 337,
"end": 340,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 337,
"end": 338,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 337,
"end": 338,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
"typeParams": null
}
]
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 362,
"end": 365,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 369,
"end": 382,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 369,
"end": 382,
"ctxt": 0
},
"value": "item",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 373,
"end": 382,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 375,
"end": 382,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 375,
"end": 379,
"ctxt": 0
},
"value": "Item",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 379,
"end": 382,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 380,
"end": 381,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 380,
"end": 381,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 345,
"end": 387,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 365,
"end": 368,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 366,
"end": 367,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 366,
"end": 367,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 383,
"end": 386,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 385,
"end": 386,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 385,
"end": 386,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 389,
"end": 427,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 393,
"end": 426,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 393,
"end": 395,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 398,
"end": 426,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 398,
"end": 401,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 402,
"end": 425,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 404,
"end": 408,
"ctxt": 0
},
"value": "kind",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 410,
"end": 413,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 415,
"end": 419,
"ctxt": 0
},
"value": "data",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 421,
"end": 423,
"ctxt": 0
},
"value": 42.0
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 439,
"end": 481,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 443,
"end": 480,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 443,
"end": 445,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 448,
"end": 480,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 448,
"end": 451,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 452,
"end": 479,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 454,
"end": 458,
"ctxt": 0
},
"value": "kind",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 460,
"end": 463,
"ctxt": 0
},
"value": "b",
"raw": "'b'"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 465,
"end": 469,
"ctxt": 0
},
"value": "data",
"optional": false
},
"value": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 471,
"end": 477,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 472,
"end": 473,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 475,
"end": 476,
"ctxt": 0
},
"value": 2.0
}
}
]
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}