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

634 lines
17 KiB
JSON

{
"type": "Script",
"span": {
"start": 93,
"end": 567,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 93,
"end": 278,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 136,
"end": 204,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 136,
"end": 147,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 151,
"end": 204,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 161,
"end": 171,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 161,
"end": 171,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 161,
"end": 167,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 161,
"end": 165,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 180,
"end": 198,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 180,
"end": 198,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 180,
"end": 192,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 180,
"end": 184,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 185,
"end": 192,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 195,
"end": 198,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
}
]
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 238,
"end": 276,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 238,
"end": 239,
"ctxt": 0
},
"value": "m",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 238,
"end": 276,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 243,
"end": 276,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 253,
"end": 270,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 260,
"end": 270,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 260,
"end": 266,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 260,
"end": 264,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 265,
"end": 266,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 269,
"end": 270,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
]
},
"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": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 288,
"end": 292,
"ctxt": 0
},
"value": "exec",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 279,
"end": 409,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 295,
"end": 409,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 301,
"end": 326,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 307,
"end": 325,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 307,
"end": 313,
"ctxt": 0
},
"value": "module",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 316,
"end": 325,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 320,
"end": 321,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 322,
"end": 324,
"ctxt": 0
},
"value": 12.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ReturnStatement",
"span": {
"start": 331,
"end": 353,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 338,
"end": 352,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 338,
"end": 344,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 345,
"end": 352,
"ctxt": 0
},
"value": "exports",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 420,
"end": 426,
"ctxt": 0
},
"value": "tricky",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 411,
"end": 567,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 429,
"end": 567,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 484,
"end": 509,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 490,
"end": 508,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 490,
"end": 496,
"ctxt": 0
},
"value": "module",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 499,
"end": 508,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 503,
"end": 504,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 505,
"end": 507,
"ctxt": 0
},
"value": 12.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ReturnStatement",
"span": {
"start": 514,
"end": 565,
"ctxt": 0
},
"argument": {
"type": "ArrowFunctionExpression",
"span": {
"start": 521,
"end": 565,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 527,
"end": 565,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 537,
"end": 559,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 544,
"end": 558,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 544,
"end": 550,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 551,
"end": 558,
"ctxt": 0
},
"value": "exports",
"optional": false
}
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}