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

759 lines
20 KiB
JSON

{
"type": "Script",
"span": {
"start": 15,
"end": 273,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 15,
"end": 204,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 29,
"end": 73,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 29,
"end": 46,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 30,
"end": 45,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 30,
"end": 36,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 37,
"end": 45,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 47,
"end": 56,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 47,
"end": 56,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 48,
"end": 56,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 50,
"end": 56,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 29,
"end": 73,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 57,
"end": 72,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 59,
"end": 72,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 61,
"end": 70,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 62,
"end": 70,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 64,
"end": 70,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 78,
"end": 138,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 78,
"end": 95,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 79,
"end": 94,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 79,
"end": 85,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 86,
"end": 94,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 96,
"end": 106,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 96,
"end": 106,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 97,
"end": 106,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 99,
"end": 106,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 99,
"end": 106,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 78,
"end": 138,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 107,
"end": 137,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 109,
"end": 137,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 111,
"end": 121,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 112,
"end": 120,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 114,
"end": 120,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 122,
"end": 135,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 122,
"end": 127,
"ctxt": 0
},
"value": "hello",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 127,
"end": 135,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 129,
"end": 135,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 143,
"end": 202,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 143,
"end": 160,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 144,
"end": 159,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 144,
"end": 150,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 151,
"end": 159,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 161,
"end": 167,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 161,
"end": 167,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 162,
"end": 167,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 164,
"end": 167,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 143,
"end": 202,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 169,
"end": 202,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 179,
"end": 196,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 186,
"end": 195,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
]
},
"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": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 206,
"end": 220,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 210,
"end": 219,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 214,
"end": 219,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 218,
"end": 219,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 221,
"end": 244,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 221,
"end": 243,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 221,
"end": 239,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 222,
"end": 239,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 223,
"end": 238,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 223,
"end": 229,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 230,
"end": 238,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 245,
"end": 273,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 245,
"end": 272,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 245,
"end": 263,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 245,
"end": 246,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 246,
"end": 263,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 247,
"end": 262,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 247,
"end": 253,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 254,
"end": 262,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 264,
"end": 271,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}