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

350 lines
9.0 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 37,
"end": 159,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 43,
"end": 44,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 37,
"end": 159,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 51,
"end": 83,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 51,
"end": 71,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 52,
"end": 70,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 52,
"end": 58,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 59,
"end": 70,
"ctxt": 0
},
"value": "toPrimitive",
"optional": false
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 72,
"end": 81,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 72,
"end": 81,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 73,
"end": 81,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 75,
"end": 81,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 51,
"end": 83,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 88,
"end": 120,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 88,
"end": 108,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 89,
"end": 107,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 89,
"end": 95,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 96,
"end": 107,
"ctxt": 0
},
"value": "toPrimitive",
"optional": false
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 118,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 88,
"end": 120,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 125,
"end": 157,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 125,
"end": 145,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 126,
"end": 144,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 126,
"end": 132,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 133,
"end": 144,
"ctxt": 0
},
"value": "toPrimitive",
"optional": false
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 146,
"end": 152,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 146,
"end": 152,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 147,
"end": 152,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 149,
"end": 152,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 125,
"end": 157,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"stmts": []
},
"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": []
}
],
"interpreter": null
}