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

326 lines
7.9 KiB
JSON

{
"type": "Module",
"span": {
"start": 60,
"end": 216,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 60,
"end": 103,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 73,
"end": 77,
"ctxt": 0
},
"value": "Task",
"optional": false
},
"declare": false,
"span": {
"start": 67,
"end": 103,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 89,
"end": 96,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 96,
"end": 99,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
},
"implements": []
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 127,
"end": 157,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 136,
"end": 140,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 136,
"end": 140,
"ctxt": 0
},
"value": "Task",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 148,
"end": 156,
"ctxt": 0
},
"value": "./task",
"raw": "\"./task\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 164,
"end": 168,
"ctxt": 0
},
"value": "Test",
"optional": false
},
"declare": false,
"span": {
"start": 158,
"end": 216,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 175,
"end": 214,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 181,
"end": 188,
"ctxt": 0
},
"value": "example",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 175,
"end": 214,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 203,
"end": 214,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 205,
"end": 212,
"ctxt": 0
},
"argument": null
}
]
},
"generator": false,
"async": true,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 188,
"end": 191,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 189,
"end": 190,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 189,
"end": 190,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 193,
"end": 202,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 195,
"end": 202,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 195,
"end": 199,
"ctxt": 0
},
"value": "Task",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 199,
"end": 202,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 200,
"end": 201,
"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
}