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

758 lines
19 KiB
JSON

{
"type": "Module",
"span": {
"start": 135,
"end": 733,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 135,
"end": 180,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 147,
"end": 179,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 147,
"end": 154,
"ctxt": 0
},
"value": "require",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 154,
"end": 179,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 156,
"end": 179,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 157,
"end": 171,
"ctxt": 0
},
"rest": {
"start": 157,
"end": 160,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 160,
"end": 164,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 164,
"end": 171,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 166,
"end": 171,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 166,
"end": 169,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 173,
"end": 179,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 176,
"end": 179,
"ctxt": 0
},
"kind": "any"
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 210,
"end": 308,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 225,
"end": 229,
"ctxt": 0
},
"value": "fs",
"raw": "\"fs\""
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 230,
"end": 308,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 236,
"end": 306,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 252,
"end": 264,
"ctxt": 0
},
"value": "readFileSync",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 265,
"end": 277,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 265,
"end": 277,
"ctxt": 0
},
"value": "path",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 269,
"end": 277,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 271,
"end": 277,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 279,
"end": 296,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 279,
"end": 296,
"ctxt": 0
},
"value": "encoding",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 288,
"end": 296,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 290,
"end": 296,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 243,
"end": 306,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 297,
"end": 305,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 299,
"end": 305,
"ctxt": 0
},
"kind": "string"
}
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 309,
"end": 457,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 324,
"end": 330,
"ctxt": 0
},
"value": "path",
"raw": "\"path\""
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 331,
"end": 457,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 337,
"end": 363,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 344,
"end": 346,
"ctxt": 0
},
"value": "fs",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 349,
"end": 362,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 357,
"end": 361,
"ctxt": 0
},
"value": "fs",
"raw": "\"fs\""
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 374,
"end": 430,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 384,
"end": 388,
"ctxt": 0
},
"value": "path",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 389,
"end": 430,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 399,
"end": 424,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 406,
"end": 424,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 412,
"end": 423,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 412,
"end": 415,
"ctxt": 0
},
"value": "sep",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 415,
"end": 423,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 417,
"end": 423,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsExportAssignment",
"span": {
"start": 435,
"end": 449,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 444,
"end": 448,
"ctxt": 0
},
"value": "path",
"optional": false
}
}
]
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 484,
"end": 505,
"ctxt": 0
},
"specifiers": [],
"source": {
"type": "StringLiteral",
"span": {
"start": 499,
"end": 504,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 506,
"end": 520,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 506,
"end": 519,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 506,
"end": 512,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 513,
"end": 518,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 521,
"end": 546,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 527,
"end": 545,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 527,
"end": 528,
"ctxt": 0
},
"value": "_",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 531,
"end": 545,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 531,
"end": 538,
"ctxt": 0
},
"value": "require",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 539,
"end": 544,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 564,
"end": 568,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 564,
"end": 567,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"value": "_",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 566,
"end": 567,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 600,
"end": 621,
"ctxt": 0
},
"specifiers": [],
"source": {
"type": "StringLiteral",
"span": {
"start": 615,
"end": 620,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 622,
"end": 648,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 629,
"end": 630,
"ctxt": 0
},
"value": "_",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 633,
"end": 647,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 641,
"end": 646,
"ctxt": 0
},
"value": "./a",
"raw": "\"./a\""
}
}
},
{
"type": "TsExportAssignment",
"span": {
"start": 658,
"end": 670,
"ctxt": 0
},
"expression": {
"type": "ObjectExpression",
"span": {
"start": 667,
"end": 669,
"ctxt": 0
},
"properties": []
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 680,
"end": 690,
"ctxt": 0
},
"specifiers": [],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 712,
"end": 733,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 719,
"end": 733,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 725,
"end": 732,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 725,
"end": 726,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 729,
"end": 732,
"ctxt": 0
},
"value": "a",
"raw": "\"a\""
},
"definite": false
}
]
}
}
],
"interpreter": null
}