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

457 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 143,
"end": 411,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 152,
"end": 155,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 143,
"end": 180,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 159,
"end": 180,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 165,
"end": 178,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 172,
"end": 177,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 188,
"end": 197,
"ctxt": 0
},
"value": "SomeClass",
"optional": false
},
"declare": false,
"span": {
"start": 182,
"end": 235,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 204,
"end": 233,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 204,
"end": 233,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 208,
"end": 233,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 218,
"end": 227,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"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": "ExpressionStatement",
"span": {
"start": 237,
"end": 280,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 237,
"end": 280,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 237,
"end": 251,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 237,
"end": 243,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 244,
"end": 251,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 254,
"end": 280,
"ctxt": 0
},
"properties": [
{
"type": "Identifier",
"span": {
"start": 260,
"end": 263,
"ctxt": 0
},
"value": "bar",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 269,
"end": 278,
"ctxt": 0
},
"value": "SomeClass",
"optional": false
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 303,
"end": 362,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 309,
"end": 361,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 309,
"end": 342,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 311,
"end": 320,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 311,
"end": 320,
"ctxt": 0
},
"value": "SomeClass",
"optional": false
},
"value": null
},
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 322,
"end": 331,
"ctxt": 0
},
"value": "SomeClass",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 333,
"end": 340,
"ctxt": 0
},
"value": "Another",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 345,
"end": 361,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 345,
"end": 352,
"ctxt": 0
},
"value": "require",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 353,
"end": 360,
"ctxt": 0
},
"value": "./lib",
"raw": "'./lib'"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 364,
"end": 411,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 364,
"end": 411,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 364,
"end": 378,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 364,
"end": 370,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 371,
"end": 378,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 381,
"end": 411,
"ctxt": 0
},
"properties": [
{
"type": "Identifier",
"span": {
"start": 387,
"end": 396,
"ctxt": 0
},
"value": "SomeClass",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 402,
"end": 409,
"ctxt": 0
},
"value": "Another",
"optional": false
}
]
}
}
}
],
"interpreter": null
}