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

647 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 15,
"end": 334,
"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": 57,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 29,
"end": 55,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 41,
"end": 54,
"ctxt": 0
},
"value": "Hello world",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 30,
"end": 38,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 32,
"end": 38,
"ctxt": 0
},
"kind": "string"
}
},
"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": 65,
"end": 66,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 59,
"end": 163,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 73,
"end": 99,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 85,
"end": 98,
"ctxt": 0
},
"value": "Hello world",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 74,
"end": 82,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 76,
"end": 82,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 104,
"end": 114,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 105,
"end": 113,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 107,
"end": 113,
"ctxt": 0
},
"kind": "number"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 119,
"end": 161,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 119,
"end": 130,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 133,
"end": 161,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 143,
"end": 155,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 143,
"end": 154,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 143,
"end": 149,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 143,
"end": 147,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 152,
"end": 154,
"ctxt": 0
},
"value": 10.0
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "E",
"optional": false
},
"declare": false,
"span": {
"start": 165,
"end": 208,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 188,
"end": 206,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "z",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 201,
"end": 205,
"ctxt": 0
},
"value": true
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 189,
"end": 198,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 191,
"end": 198,
"ctxt": 0
},
"kind": "boolean"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 181,
"end": 182,
"ctxt": 0
},
"value": "D",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"value": "F",
"optional": false
},
"declare": false,
"span": {
"start": 210,
"end": 334,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 233,
"end": 251,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": "z",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 246,
"end": 250,
"ctxt": 0
},
"value": true
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 234,
"end": 243,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 236,
"end": 243,
"ctxt": 0
},
"kind": "boolean"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 256,
"end": 266,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 256,
"end": 257,
"ctxt": 0
},
"value": "j",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 257,
"end": 265,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 259,
"end": 265,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 271,
"end": 332,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 271,
"end": 282,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 285,
"end": 332,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 295,
"end": 303,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 295,
"end": 302,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 295,
"end": 300,
"ctxt": 0
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 312,
"end": 326,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 312,
"end": 325,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 312,
"end": 318,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 312,
"end": 316,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "j",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 321,
"end": 325,
"ctxt": 0
},
"value": "HI",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "D",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}