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

979 lines
26 KiB
JSON

{
"type": "Script",
"span": {
"start": 99,
"end": 510,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 99,
"end": 177,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 109,
"end": 113,
"ctxt": 0
},
"value": "List",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 113,
"end": 116,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 117,
"end": 177,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 123,
"end": 131,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 123,
"end": 127,
"ctxt": 0
},
"value": "data",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 127,
"end": 130,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 136,
"end": 150,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 136,
"end": 140,
"ctxt": 0
},
"value": "next",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 140,
"end": 149,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 142,
"end": 149,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 142,
"end": 146,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 146,
"end": 149,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 155,
"end": 175,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 155,
"end": 160,
"ctxt": 0
},
"value": "owner",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 160,
"end": 174,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 162,
"end": 174,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 162,
"end": 171,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 171,
"end": 174,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 257,
"end": 323,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 267,
"end": 276,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 276,
"end": 279,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 277,
"end": 278,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 277,
"end": 278,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 288,
"end": 301,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 288,
"end": 292,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 292,
"end": 301,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 293,
"end": 300,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 293,
"end": 297,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 297,
"end": 300,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 302,
"end": 323,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 308,
"end": 321,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 308,
"end": 312,
"ctxt": 0
},
"value": "name",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 312,
"end": 320,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 314,
"end": 320,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 325,
"end": 348,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 329,
"end": 347,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 329,
"end": 333,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 333,
"end": 347,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 335,
"end": 347,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 335,
"end": 339,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 339,
"end": 347,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 340,
"end": 346,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 349,
"end": 382,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 353,
"end": 381,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 353,
"end": 362,
"ctxt": 0
},
"value": "ownerList",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 362,
"end": 381,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 364,
"end": 381,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 364,
"end": 373,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 373,
"end": 381,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 374,
"end": 380,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 383,
"end": 400,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 383,
"end": 399,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 383,
"end": 387,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 390,
"end": 399,
"ctxt": 0
},
"value": "ownerList",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 412,
"end": 417,
"ctxt": 0
},
"value": "other",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 421,
"end": 425,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 421,
"end": 425,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 422,
"end": 425,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 424,
"end": 425,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 424,
"end": 425,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 403,
"end": 510,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 427,
"end": 510,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 433,
"end": 451,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 437,
"end": 450,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 437,
"end": 441,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 441,
"end": 450,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 443,
"end": 450,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 443,
"end": 447,
"ctxt": 0
},
"value": "List",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 447,
"end": 450,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 448,
"end": 449,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 448,
"end": 449,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 456,
"end": 484,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 460,
"end": 483,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 460,
"end": 469,
"ctxt": 0
},
"value": "ownerList",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 469,
"end": 483,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 471,
"end": 483,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 471,
"end": 480,
"ctxt": 0
},
"value": "OwnerList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 480,
"end": 483,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 481,
"end": 482,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 481,
"end": 482,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 489,
"end": 506,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 489,
"end": 505,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 489,
"end": 493,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 496,
"end": 505,
"ctxt": 0
},
"value": "ownerList",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 417,
"end": 420,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"returnType": null
}
],
"interpreter": null
}