mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
477 lines
14 KiB
JSON
477 lines
14 KiB
JSON
{
|
|
"type": "Module",
|
|
"span": {
|
|
"start": 55,
|
|
"end": 342,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "ExportDeclaration",
|
|
"span": {
|
|
"start": 55,
|
|
"end": 104,
|
|
"ctxt": 0
|
|
},
|
|
"declaration": {
|
|
"type": "ClassDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 68,
|
|
"end": 69,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"span": {
|
|
"start": 62,
|
|
"end": 104,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"body": [
|
|
{
|
|
"type": "ClassMethod",
|
|
"span": {
|
|
"start": 76,
|
|
"end": 102,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 76,
|
|
"end": 81,
|
|
"ctxt": 0
|
|
},
|
|
"value": "print",
|
|
"optional": false
|
|
},
|
|
"function": {
|
|
"params": [],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 76,
|
|
"end": 102,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 84,
|
|
"end": 102,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 86,
|
|
"end": 101,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 93,
|
|
"end": 101,
|
|
"ctxt": 0
|
|
},
|
|
"value": "I am B",
|
|
"raw": "\"I am B\""
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"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": 218,
|
|
"end": 221,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 222,
|
|
"end": 237,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 222,
|
|
"end": 237,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 223,
|
|
"end": 237,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 225,
|
|
"end": 237,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 225,
|
|
"end": 232,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Promise",
|
|
"optional": false
|
|
},
|
|
"typeParams": {
|
|
"type": "TsTypeParameterInstantiation",
|
|
"span": {
|
|
"start": 232,
|
|
"end": 237,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 233,
|
|
"end": 236,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "any"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 209,
|
|
"end": 321,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 239,
|
|
"end": 321,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 245,
|
|
"end": 319,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 245,
|
|
"end": 319,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 245,
|
|
"end": 251,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 245,
|
|
"end": 246,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 247,
|
|
"end": 251,
|
|
"ctxt": 0
|
|
},
|
|
"value": "then",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "ArrowFunctionExpression",
|
|
"span": {
|
|
"start": 252,
|
|
"end": 318,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 252,
|
|
"end": 257,
|
|
"ctxt": 0
|
|
},
|
|
"value": "value",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
}
|
|
],
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 261,
|
|
"end": 318,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 271,
|
|
"end": 293,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 275,
|
|
"end": 292,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 275,
|
|
"end": 276,
|
|
"ctxt": 0
|
|
},
|
|
"value": "b",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": {
|
|
"type": "NewExpression",
|
|
"span": {
|
|
"start": 279,
|
|
"end": 292,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 283,
|
|
"end": 290,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 283,
|
|
"end": 288,
|
|
"ctxt": 0
|
|
},
|
|
"value": "value",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 289,
|
|
"end": 290,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": null
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 302,
|
|
"end": 312,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 302,
|
|
"end": 311,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 302,
|
|
"end": 309,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 302,
|
|
"end": 303,
|
|
"ctxt": 0
|
|
},
|
|
"value": "b",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 304,
|
|
"end": 309,
|
|
"ctxt": 0
|
|
},
|
|
"value": "print",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"async": false,
|
|
"generator": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 323,
|
|
"end": 342,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 323,
|
|
"end": 341,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 323,
|
|
"end": 326,
|
|
"ctxt": 0
|
|
},
|
|
"value": "foo",
|
|
"optional": false
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 327,
|
|
"end": 340,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "Import",
|
|
"span": {
|
|
"start": 327,
|
|
"end": 333,
|
|
"ctxt": 0
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 334,
|
|
"end": 339,
|
|
"ctxt": 0
|
|
},
|
|
"value": "./0",
|
|
"raw": "\"./0\""
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
}
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|