swc/crates/swc_ecma_parser/tests/tsc/computedPropertyNames45_ES5.json
2022-03-22 07:54:08 +00:00

466 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 264,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 31,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"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": 38,
"end": 42,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"declare": false,
"span": {
"start": 32,
"end": 51,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 45,
"end": 47,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 45,
"end": 46,
"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": 48,
"end": 49,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 48,
"end": 49,
"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": 59,
"end": 60,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 53,
"end": 102,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 67,
"end": 100,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 71,
"end": 79,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 72,
"end": 78,
"ctxt": 0
},
"value": "get1",
"raw": "\"get1\""
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 67,
"end": 100,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 82,
"end": 100,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 84,
"end": 98,
"ctxt": 0
},
"argument": {
"type": "NewExpression",
"span": {
"start": 91,
"end": 98,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 95,
"end": 98,
"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": 110,
"end": 111,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 104,
"end": 264,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 216,
"end": 225,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 217,
"end": 225,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 219,
"end": 225,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 226,
"end": 232,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 228,
"end": 232,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 228,
"end": 232,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 215,
"end": 233,
"ctxt": 0
}
},
{
"type": "ClassMethod",
"span": {
"start": 238,
"end": 262,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 242,
"end": 250,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 243,
"end": 249,
"ctxt": 0
},
"value": "set1",
"raw": "\"set1\""
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 251,
"end": 257,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 251,
"end": 257,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 252,
"end": 257,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 254,
"end": 257,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 254,
"end": 257,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 238,
"end": 262,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 259,
"end": 262,
"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": 120,
"end": 121,
"ctxt": 0
},
"value": "C",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}