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

466 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 178,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 23,
"end": 26,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 17,
"end": 32,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 39,
"end": 43,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"declare": false,
"span": {
"start": 33,
"end": 52,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 46,
"end": 47,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 54,
"end": 126,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 69,
"end": 78,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 70,
"end": 78,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 72,
"end": 78,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 79,
"end": 85,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 81,
"end": 85,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 81,
"end": 85,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 68,
"end": 86,
"ctxt": 0
}
},
{
"type": "ClassMethod",
"span": {
"start": 91,
"end": 124,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 95,
"end": 103,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 96,
"end": 102,
"ctxt": 0
},
"value": "get1",
"raw": "\"get1\""
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 91,
"end": 124,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 106,
"end": 124,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 108,
"end": 122,
"ctxt": 0
},
"argument": {
"type": "NewExpression",
"span": {
"start": 115,
"end": 122,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 128,
"end": 178,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 152,
"end": 176,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 156,
"end": 164,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 157,
"end": 163,
"ctxt": 0
},
"value": "set1",
"raw": "\"set1\""
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 165,
"end": 171,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 165,
"end": 171,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 166,
"end": 171,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 168,
"end": 171,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 168,
"end": 171,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 152,
"end": 176,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 173,
"end": 176,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"value": "C",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}