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

317 lines
7.5 KiB
JSON

{
"type": "Script",
"span": {
"start": 115,
"end": 269,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 115,
"end": 147,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 121,
"end": 146,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 121,
"end": 126,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"value": "K",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 129,
"end": 146,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 129,
"end": 136,
"ctxt": 0
},
"value": "require",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 137,
"end": 145,
"ctxt": 0
},
"value": "./mod1",
"raw": "\"./mod1\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 168,
"end": 200,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 182,
"end": 200,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 188,
"end": 198,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 188,
"end": 198,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 188,
"end": 196,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "k",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 190,
"end": 196,
"ctxt": 0
},
"value": "values",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 224,
"end": 269,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 224,
"end": 268,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 224,
"end": 233,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 224,
"end": 231,
"ctxt": 0
},
"value": "exports",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"value": "K",
"optional": false
}
},
"right": {
"type": "ClassExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": "K",
"optional": false
},
"span": {
"start": 236,
"end": 268,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 250,
"end": 266,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 250,
"end": 256,
"ctxt": 0
},
"value": "values",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 250,
"end": 266,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 259,
"end": 266,
"ctxt": 0
},
"stmts": []
},
"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": []
}
}
}
],
"interpreter": null
}