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

696 lines
16 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 77,
"end": 447,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 94,
"end": 101,
"ctxt": 0
},
"value": "require",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 102,
"end": 114,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 102,
"end": 114,
"ctxt": 0
},
"value": "name",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 106,
"end": 114,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 108,
"end": 114,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 77,
"end": 121,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 115,
"end": 120,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 117,
"end": 120,
"ctxt": 0
},
"kind": "any"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 122,
"end": 147,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 134,
"end": 146,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 134,
"end": 141,
"ctxt": 0
},
"value": "exports",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 141,
"end": 146,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 143,
"end": 146,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 148,
"end": 185,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 160,
"end": 184,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 160,
"end": 166,
"ctxt": 0
},
"value": "module",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 166,
"end": 184,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 168,
"end": 184,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 170,
"end": 182,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 170,
"end": 177,
"ctxt": 0
},
"value": "exports",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 177,
"end": 182,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 179,
"end": 182,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 245,
"end": 273,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 245,
"end": 273,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 245,
"end": 252,
"ctxt": 0
},
"value": "exports",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AssignmentExpression",
"span": {
"start": 255,
"end": 273,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 255,
"end": 269,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 255,
"end": 261,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 262,
"end": 269,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 274,
"end": 296,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 274,
"end": 296,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 274,
"end": 283,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 274,
"end": 281,
"ctxt": 0
},
"value": "exports",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 286,
"end": 296,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BinaryExpression",
"span": {
"start": 291,
"end": 296,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 291,
"end": 292,
"ctxt": 0
},
"value": "n",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 295,
"end": 296,
"ctxt": 0
},
"value": 1.0
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 297,
"end": 328,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 310,
"end": 328,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 316,
"end": 326,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 316,
"end": 326,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 316,
"end": 322,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 316,
"end": 320,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 321,
"end": 322,
"ctxt": 0
},
"value": "p",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 325,
"end": 326,
"ctxt": 0
},
"value": 1.0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 387,
"end": 416,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 393,
"end": 416,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 393,
"end": 394,
"ctxt": 0
},
"value": "C",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 397,
"end": 416,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 397,
"end": 404,
"ctxt": 0
},
"value": "require",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 405,
"end": 415,
"ctxt": 0
},
"value": "./semver",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 417,
"end": 433,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 421,
"end": 433,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 421,
"end": 424,
"ctxt": 0
},
"value": "two",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 427,
"end": 433,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 427,
"end": 430,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 427,
"end": 428,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 429,
"end": 430,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 431,
"end": 432,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 434,
"end": 447,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 438,
"end": 447,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 438,
"end": 439,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 442,
"end": 447,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 446,
"end": 447,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}