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

761 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 276,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 65,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 30,
"end": 63,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 38,
"end": 55,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 39,
"end": 54,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 39,
"end": 45,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 46,
"end": 54,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 55,
"end": 62,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 57,
"end": 62,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": null,
"typeParams": null
}
]
}
},
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 66,
"end": 111,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 78,
"end": 111,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 84,
"end": 109,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "MemberExpression",
"span": {
"start": 85,
"end": 100,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 85,
"end": 91,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 92,
"end": 100,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
},
"computed": true,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 101,
"end": 108,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 103,
"end": 108,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": null,
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 130,
"end": 133,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 134,
"end": 138,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 134,
"end": 138,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 135,
"end": 138,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 113,
"end": 143,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 139,
"end": 142,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 161,
"end": 164,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 165,
"end": 171,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 165,
"end": 171,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 166,
"end": 171,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 168,
"end": 171,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 144,
"end": 178,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 172,
"end": 177,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 174,
"end": 177,
"ctxt": 0
},
"kind": "any"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 197,
"end": 200,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 201,
"end": 205,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 201,
"end": 205,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 202,
"end": 205,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 180,
"end": 210,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 206,
"end": 209,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 228,
"end": 231,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 232,
"end": 238,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 232,
"end": 238,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 233,
"end": 238,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 235,
"end": 238,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 211,
"end": 245,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 239,
"end": 244,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 241,
"end": 244,
"ctxt": 0
},
"kind": "any"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 247,
"end": 258,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 247,
"end": 257,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 247,
"end": 250,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NewExpression",
"span": {
"start": 251,
"end": 256,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 255,
"end": 256,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 259,
"end": 268,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 263,
"end": 267,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 263,
"end": 264,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 264,
"end": 267,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 269,
"end": 276,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 269,
"end": 275,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 269,
"end": 272,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 273,
"end": 274,
"ctxt": 0
},
"value": "i",
"optional": false
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}