swc/crates/swc_ecma_parser/tests/tsc/bundlerSyntaxRestrictions.json
Donny/강동윤 3958f1792c
refactor(es/ast): Remove unused fields (#7518)
**Related issue:**

 - Closes #7347.
 - Closes #7487.
2023-06-12 08:02:34 +00:00

756 lines
19 KiB
JSON

{
"type": "Module",
"span": {
"start": 154,
"end": 752,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 154,
"end": 199,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 166,
"end": 198,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 166,
"end": 173,
"ctxt": 0
},
"value": "require",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 173,
"end": 198,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 175,
"end": 198,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 176,
"end": 190,
"ctxt": 0
},
"rest": {
"start": 176,
"end": 179,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 179,
"end": 183,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 183,
"end": 190,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 185,
"end": 190,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 185,
"end": 188,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 192,
"end": 198,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 195,
"end": 198,
"ctxt": 0
},
"kind": "any"
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 229,
"end": 327,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 244,
"end": 248,
"ctxt": 0
},
"value": "fs",
"raw": "\"fs\""
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 249,
"end": 327,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 255,
"end": 325,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 271,
"end": 283,
"ctxt": 0
},
"value": "readFileSync",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 284,
"end": 296,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 284,
"end": 296,
"ctxt": 0
},
"value": "path",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 288,
"end": 296,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 290,
"end": 296,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 298,
"end": 315,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 298,
"end": 315,
"ctxt": 0
},
"value": "encoding",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 307,
"end": 315,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 309,
"end": 315,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 262,
"end": 325,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 316,
"end": 324,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 318,
"end": 324,
"ctxt": 0
},
"kind": "string"
}
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 328,
"end": 476,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 343,
"end": 349,
"ctxt": 0
},
"value": "path",
"raw": "\"path\""
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 350,
"end": 476,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 356,
"end": 382,
"ctxt": 0
},
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 363,
"end": 365,
"ctxt": 0
},
"value": "fs",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 368,
"end": 381,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 376,
"end": 380,
"ctxt": 0
},
"value": "fs",
"raw": "\"fs\""
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 393,
"end": 449,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 403,
"end": 407,
"ctxt": 0
},
"value": "path",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 408,
"end": 449,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 418,
"end": 443,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 425,
"end": 443,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 431,
"end": 442,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 431,
"end": 434,
"ctxt": 0
},
"value": "sep",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 434,
"end": 442,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 436,
"end": 442,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsExportAssignment",
"span": {
"start": 454,
"end": 468,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 463,
"end": 467,
"ctxt": 0
},
"value": "path",
"optional": false
}
}
]
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 503,
"end": 524,
"ctxt": 0
},
"specifiers": [],
"source": {
"type": "StringLiteral",
"span": {
"start": 518,
"end": 523,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 525,
"end": 539,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 525,
"end": 538,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 525,
"end": 531,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 532,
"end": 537,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 540,
"end": 565,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 546,
"end": 564,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 546,
"end": 547,
"ctxt": 0
},
"value": "_",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 550,
"end": 564,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 550,
"end": 557,
"ctxt": 0
},
"value": "require",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 558,
"end": 563,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 583,
"end": 587,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 583,
"end": 586,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 583,
"end": 584,
"ctxt": 0
},
"value": "_",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 585,
"end": 586,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 619,
"end": 640,
"ctxt": 0
},
"specifiers": [],
"source": {
"type": "StringLiteral",
"span": {
"start": 634,
"end": 639,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 641,
"end": 667,
"ctxt": 0
},
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 648,
"end": 649,
"ctxt": 0
},
"value": "_",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 652,
"end": 666,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 660,
"end": 665,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
}
}
},
{
"type": "TsExportAssignment",
"span": {
"start": 677,
"end": 689,
"ctxt": 0
},
"expression": {
"type": "ObjectExpression",
"span": {
"start": 686,
"end": 688,
"ctxt": 0
},
"properties": []
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 699,
"end": 709,
"ctxt": 0
},
"specifiers": [],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 731,
"end": 752,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 738,
"end": 752,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 744,
"end": 751,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 744,
"end": 745,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 748,
"end": 751,
"ctxt": 0
},
"value": "a",
"raw": "\"a\""
},
"definite": false
}
]
}
}
],
"interpreter": null
}