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

994 lines
26 KiB
JSON

{
"type": "Script",
"span": {
"start": 54,
"end": 484,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 54,
"end": 118,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 70,
"end": 79,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 71,
"end": 79,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 73,
"end": 79,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 88,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 82,
"end": 88,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 69,
"end": 89,
"ctxt": 0
}
},
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 96,
"end": 105,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 97,
"end": 105,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 99,
"end": 105,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 106,
"end": 114,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 108,
"end": 114,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 95,
"end": 115,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 122,
"end": 190,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 134,
"end": 190,
"ctxt": 0
},
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 142,
"end": 151,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 143,
"end": 151,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 145,
"end": 151,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 154,
"end": 160,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 141,
"end": 161,
"ctxt": 0
}
},
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 168,
"end": 177,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 169,
"end": 177,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 171,
"end": 177,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 178,
"end": 186,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 180,
"end": 186,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 167,
"end": 187,
"ctxt": 0
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 194,
"end": 257,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 198,
"end": 257,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 198,
"end": 199,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 199,
"end": 257,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 201,
"end": 257,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 209,
"end": 218,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 210,
"end": 218,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 212,
"end": 218,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 219,
"end": 227,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 221,
"end": 227,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 208,
"end": 228,
"ctxt": 0
}
},
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 235,
"end": 244,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 236,
"end": 244,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 238,
"end": 244,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 245,
"end": 253,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 247,
"end": 253,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 234,
"end": 254,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 261,
"end": 336,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 265,
"end": 336,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 265,
"end": 266,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 266,
"end": 324,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 268,
"end": 324,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 276,
"end": 285,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 277,
"end": 285,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 279,
"end": 285,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 286,
"end": 294,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 288,
"end": 294,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 275,
"end": 295,
"ctxt": 0
}
},
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 302,
"end": 311,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 303,
"end": 311,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 305,
"end": 311,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 312,
"end": 320,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 314,
"end": 320,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 301,
"end": 321,
"ctxt": 0
}
}
]
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 327,
"end": 336,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 332,
"end": 334,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 346,
"end": 348,
"ctxt": 0
},
"value": "C2",
"optional": false
},
"declare": false,
"span": {
"start": 340,
"end": 408,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 360,
"end": 369,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 361,
"end": 369,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 363,
"end": 369,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 370,
"end": 378,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 372,
"end": 378,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 359,
"end": 379,
"ctxt": 0
}
},
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 386,
"end": 395,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 387,
"end": 395,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 389,
"end": 395,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 396,
"end": 404,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 398,
"end": 404,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 385,
"end": 405,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 348,
"end": 351,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 349,
"end": 350,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 349,
"end": 350,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 412,
"end": 484,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 422,
"end": 424,
"ctxt": 0
},
"value": "I2",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 424,
"end": 427,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 425,
"end": 426,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 425,
"end": 426,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 428,
"end": 484,
"ctxt": 0
},
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 436,
"end": 445,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 437,
"end": 445,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 439,
"end": 445,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 446,
"end": 454,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 448,
"end": 454,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 435,
"end": 455,
"ctxt": 0
}
},
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 462,
"end": 471,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 463,
"end": 471,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 465,
"end": 471,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 472,
"end": 480,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 474,
"end": 480,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 461,
"end": 481,
"ctxt": 0
}
}
]
}
}
],
"interpreter": null
}