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

341 lines
8.2 KiB
JSON

{
"type": "Script",
"span": {
"start": 222,
"end": 443,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 222,
"end": 240,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 222,
"end": 240,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 222,
"end": 236,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 222,
"end": 228,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 229,
"end": 236,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 239,
"end": 240,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 241,
"end": 272,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 254,
"end": 272,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 260,
"end": 270,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"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": "p",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 269,
"end": 270,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 343,
"end": 344,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 334,
"end": 443,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 348,
"end": 443,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 354,
"end": 415,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 358,
"end": 369,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "NumericLiteral",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 364,
"end": 369,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "NumericLiteral",
"span": {
"start": 364,
"end": 365,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 368,
"end": 369,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 371,
"end": 415,
"ctxt": 0
},
"stmts": []
},
"alternate": null
},
{
"type": "ReturnStatement",
"span": {
"start": 420,
"end": 441,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 427,
"end": 441,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 427,
"end": 428,
"ctxt": 0
},
"value": "k",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 429,
"end": 440,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 431,
"end": 433,
"ctxt": 0
},
"value": "ok",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 435,
"end": 439,
"ctxt": 0
},
"value": true
}
}
]
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}