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

337 lines
8.1 KiB
JSON

{
"type": "Script",
"span": {
"start": 221,
"end": 442,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 221,
"end": 239,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 221,
"end": 239,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 221,
"end": 235,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 221,
"end": 227,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 228,
"end": 235,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 238,
"end": 239,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 249,
"end": 250,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 240,
"end": 271,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 253,
"end": 271,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 259,
"end": 269,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 259,
"end": 269,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 259,
"end": 265,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 259,
"end": 263,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "p",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 268,
"end": 269,
"ctxt": 0
},
"value": 1.0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 342,
"end": 343,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 333,
"end": 442,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 347,
"end": 442,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 353,
"end": 414,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 357,
"end": 368,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "NumericLiteral",
"span": {
"start": 357,
"end": 358,
"ctxt": 0
},
"value": 1.0
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 363,
"end": 368,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "NumericLiteral",
"span": {
"start": 363,
"end": 364,
"ctxt": 0
},
"value": 2.0
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"value": 1.0
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 370,
"end": 414,
"ctxt": 0
},
"stmts": []
},
"alternate": null
},
{
"type": "ReturnStatement",
"span": {
"start": 419,
"end": 440,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 426,
"end": 440,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 426,
"end": 427,
"ctxt": 0
},
"value": "k",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 428,
"end": 439,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 430,
"end": 432,
"ctxt": 0
},
"value": "ok",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 434,
"end": 438,
"ctxt": 0
},
"value": true
}
}
]
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}