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

845 lines
20 KiB
JSON

{
"type": "Script",
"span": {
"start": 58,
"end": 417,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 58,
"end": 74,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 62,
"end": 74,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 62,
"end": 63,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 63,
"end": 68,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 65,
"end": 68,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 65,
"end": 68,
"ctxt": 0
},
"value": "p",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
},
"init": {
"type": "StringLiteral",
"span": {
"start": 71,
"end": 74,
"ctxt": 0
},
"value": "p",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 75,
"end": 255,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 89,
"end": 99,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 93,
"end": 99,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 93,
"end": 97,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "b",
"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": 110,
"end": 119,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"value": "c",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 124,
"end": 147,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 124,
"end": 136,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 125,
"end": 135,
"ctxt": 0
},
"value": "computed",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 139,
"end": 141,
"ctxt": 0
},
"value": 13.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 147,
"end": 155,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 147,
"end": 150,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 153,
"end": 155,
"ctxt": 0
},
"value": 14.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 160,
"end": 167,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "m",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 160,
"end": 167,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 164,
"end": 167,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "Constructor",
"span": {
"start": 172,
"end": 214,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 172,
"end": 183,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 184,
"end": 209,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": true,
"param": {
"type": "Identifier",
"span": {
"start": 200,
"end": 209,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 201,
"end": 209,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 203,
"end": 209,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 211,
"end": 214,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassProperty",
"span": {
"start": 219,
"end": 229,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 219,
"end": 220,
"ctxt": 0
},
"value": "z",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 223,
"end": 229,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 223,
"end": 227,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 234,
"end": 253,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 242,
"end": 252,
"ctxt": 0
},
"value": "notEmitted",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": true,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 262,
"end": 263,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 256,
"end": 281,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 270,
"end": 279,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 277,
"end": 278,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "public",
"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": 288,
"end": 289,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 282,
"end": 417,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 306,
"end": 323,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 321,
"end": 322,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": true,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 328,
"end": 339,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 328,
"end": 329,
"ctxt": 0
},
"value": "z",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 332,
"end": 339,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 332,
"end": 336,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 337,
"end": 339,
"ctxt": 0
},
"value": "ka",
"optional": false
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 344,
"end": 398,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 344,
"end": 355,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 356,
"end": 373,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 363,
"end": 373,
"ctxt": 0
},
"value": "ka",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 365,
"end": 373,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 367,
"end": 373,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 375,
"end": 398,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 385,
"end": 392,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 385,
"end": 392,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 385,
"end": 390,
"ctxt": 0
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassProperty",
"span": {
"start": 403,
"end": 415,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 403,
"end": 405,
"ctxt": 0
},
"value": "ki",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 408,
"end": 415,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 408,
"end": 412,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 413,
"end": 415,
"ctxt": 0
},
"value": "ka",
"optional": false
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"value": "B",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}