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

324 lines
7.8 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 87,
"end": 243,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 87,
"end": 130,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 100,
"end": 104,
"ctxt": 0
},
"value": "Task",
"optional": false
},
"declare": false,
"span": {
"start": 94,
"end": 130,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 116,
"end": 123,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 104,
"end": 107,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 123,
"end": 126,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 124,
"end": 125,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 124,
"end": 125,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
},
"implements": []
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 154,
"end": 184,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 163,
"end": 167,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 163,
"end": 167,
"ctxt": 0
},
"value": "Task",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 175,
"end": 183,
"ctxt": 0
},
"value": "./task",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 191,
"end": 195,
"ctxt": 0
},
"value": "Test",
"optional": false
},
"declare": false,
"span": {
"start": 185,
"end": 243,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 202,
"end": 241,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 208,
"end": 215,
"ctxt": 0
},
"value": "example",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 202,
"end": 241,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 230,
"end": 241,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 232,
"end": 239,
"ctxt": 0
},
"argument": null
}
]
},
"generator": false,
"async": true,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 215,
"end": 218,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 220,
"end": 229,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 222,
"end": 229,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 222,
"end": 226,
"ctxt": 0
},
"value": "Task",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 226,
"end": 229,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}