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

326 lines
7.9 KiB
JSON

{
"type": "Module",
"span": {
"start": 88,
"end": 244,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 88,
"end": 131,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 101,
"end": 105,
"ctxt": 0
},
"value": "Task",
"optional": false
},
"declare": false,
"span": {
"start": 95,
"end": 131,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 117,
"end": 124,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 105,
"end": 108,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 124,
"end": 127,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 125,
"end": 126,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 125,
"end": 126,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
},
"implements": []
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 155,
"end": 185,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 164,
"end": 168,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 164,
"end": 168,
"ctxt": 0
},
"value": "Task",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 176,
"end": 184,
"ctxt": 0
},
"value": "./task",
"raw": "\"./task\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 192,
"end": 196,
"ctxt": 0
},
"value": "Test",
"optional": false
},
"declare": false,
"span": {
"start": 186,
"end": 244,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 203,
"end": 242,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 209,
"end": 216,
"ctxt": 0
},
"value": "example",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 203,
"end": 242,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 231,
"end": 242,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 233,
"end": 240,
"ctxt": 0
},
"argument": null
}
]
},
"generator": false,
"async": true,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 216,
"end": 219,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 221,
"end": 230,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 223,
"end": 230,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 223,
"end": 227,
"ctxt": 0
},
"value": "Task",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 227,
"end": 230,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"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
}