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

468 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 96,
"end": 366,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 96,
"end": 125,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 102,
"end": 124,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 102,
"end": 108,
"ctxt": 0
},
"value": "donkey",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 111,
"end": 124,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 112,
"end": 115,
"ctxt": 0
},
"value": "ast",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "Identifier",
"span": {
"start": 121,
"end": 124,
"ctxt": 0
},
"value": "ast",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 136,
"end": 141,
"ctxt": 0
},
"value": "funky",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 142,
"end": 153,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 142,
"end": 153,
"ctxt": 0
},
"value": "declaration",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 127,
"end": 176,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 155,
"end": 176,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 161,
"end": 174,
"ctxt": 0
},
"argument": {
"type": "BooleanLiteral",
"span": {
"start": 168,
"end": 173,
"ctxt": 0
},
"value": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 177,
"end": 201,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 177,
"end": 200,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 177,
"end": 191,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 177,
"end": 183,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 184,
"end": 191,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 194,
"end": 200,
"ctxt": 0
},
"value": "donkey",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 202,
"end": 231,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 202,
"end": 230,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 202,
"end": 222,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 202,
"end": 216,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 202,
"end": 208,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 209,
"end": 216,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 217,
"end": 222,
"ctxt": 0
},
"value": "funky",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 225,
"end": 230,
"ctxt": 0
},
"value": "funky",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 259,
"end": 312,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 265,
"end": 311,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 265,
"end": 274,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 267,
"end": 272,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 267,
"end": 272,
"ctxt": 0
},
"value": "funky",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 277,
"end": 311,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 277,
"end": 284,
"ctxt": 0
},
"value": "require",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 285,
"end": 310,
"ctxt": 0
},
"value": "./commonJSAliasedExport",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 336,
"end": 345,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 340,
"end": 345,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 340,
"end": 345,
"ctxt": 0
},
"value": "diddy",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 346,
"end": 366,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 350,
"end": 366,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 350,
"end": 355,
"ctxt": 0
},
"value": "diddy",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 358,
"end": 366,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 358,
"end": 363,
"ctxt": 0
},
"value": "funky",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 364,
"end": 365,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}