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

321 lines
7.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 114,
"end": 268,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 114,
"end": 146,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 120,
"end": 145,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 120,
"end": 125,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "K",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 128,
"end": 145,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 128,
"end": 135,
"ctxt": 0
},
"value": "require",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 136,
"end": 144,
"ctxt": 0
},
"value": "./mod1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 178,
"end": 179,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 178,
"end": 179,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 167,
"end": 199,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 181,
"end": 199,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 187,
"end": 197,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 187,
"end": 197,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 187,
"end": 195,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"value": "k",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 189,
"end": 195,
"ctxt": 0
},
"value": "values",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 223,
"end": 268,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 223,
"end": 267,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 223,
"end": 232,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 223,
"end": 230,
"ctxt": 0
},
"value": "exports",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "K",
"optional": false
}
},
"right": {
"type": "ClassExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "K",
"optional": false
},
"span": {
"start": 235,
"end": 267,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 249,
"end": 265,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 249,
"end": 255,
"ctxt": 0
},
"value": "values",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 249,
"end": 265,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 258,
"end": 265,
"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
}