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

1084 lines
29 KiB
JSON

{
"type": "Script",
"span": {
"start": 143,
"end": 568,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 143,
"end": 157,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 147,
"end": 156,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 148,
"end": 156,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 150,
"end": 156,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 158,
"end": 231,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 165,
"end": 167,
"ctxt": 0
},
"value": "M1",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 168,
"end": 231,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 174,
"end": 195,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 181,
"end": 195,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 185,
"end": 194,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 185,
"end": 186,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 186,
"end": 194,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 188,
"end": 194,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 200,
"end": 210,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 204,
"end": 209,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "s",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 215,
"end": 229,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 219,
"end": 228,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 219,
"end": 220,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 220,
"end": 228,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 222,
"end": 228,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 233,
"end": 299,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 243,
"end": 299,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 249,
"end": 263,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 253,
"end": 262,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 253,
"end": 254,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 254,
"end": 262,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 256,
"end": 262,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 268,
"end": 278,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 272,
"end": 277,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"value": "s",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 283,
"end": 297,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 287,
"end": 296,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 287,
"end": 288,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 288,
"end": 296,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 290,
"end": 296,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 310,
"end": 312,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 301,
"end": 373,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 315,
"end": 373,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 321,
"end": 336,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 325,
"end": 335,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 325,
"end": 326,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 326,
"end": 335,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 328,
"end": 335,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 341,
"end": 351,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 345,
"end": 350,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 349,
"end": 350,
"ctxt": 0
},
"value": "s",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 356,
"end": 371,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 360,
"end": 370,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 360,
"end": 361,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 361,
"end": 370,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 363,
"end": 370,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 381,
"end": 382,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 375,
"end": 476,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 389,
"end": 397,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "s",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 390,
"end": 396,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 392,
"end": 396,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 392,
"end": 396,
"ctxt": 0
},
"value": "Date",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 402,
"end": 413,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 402,
"end": 403,
"ctxt": 0
},
"value": "n",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 406,
"end": 412,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 406,
"end": 410,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 411,
"end": 412,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 418,
"end": 474,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"value": "x",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 418,
"end": 474,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 422,
"end": 474,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 432,
"end": 447,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 436,
"end": 446,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 436,
"end": 437,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 440,
"end": 446,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 440,
"end": 444,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 445,
"end": 446,
"ctxt": 0
},
"value": "n",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 456,
"end": 468,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 460,
"end": 467,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 460,
"end": 461,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 461,
"end": 467,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 463,
"end": 467,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 463,
"end": 467,
"ctxt": 0
},
"value": "Date",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 478,
"end": 568,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 485,
"end": 487,
"ctxt": 0
},
"value": "M3",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 488,
"end": 568,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 494,
"end": 505,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 498,
"end": 504,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 498,
"end": 499,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 499,
"end": 504,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 501,
"end": 504,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 510,
"end": 566,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 517,
"end": 519,
"ctxt": 0
},
"value": "M4",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 520,
"end": 566,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 530,
"end": 540,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 534,
"end": 539,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 534,
"end": 535,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 538,
"end": 539,
"ctxt": 0
},
"value": "s",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 549,
"end": 560,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 553,
"end": 559,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 553,
"end": 554,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 554,
"end": 559,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 556,
"end": 559,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
}
]
}
}
]
}
}
],
"interpreter": null
}