swc/crates/swc_ecma_parser/tests/tsc/constEnumPropertyAccess2.json
2022-02-04 17:08:38 +09:00

545 lines
12 KiB
JSON

{
"type": "Script",
"span": {
"start": 248,
"end": 482,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 248,
"end": 315,
"ctxt": 0
},
"declare": false,
"isConst": true,
"id": {
"type": "Identifier",
"span": {
"start": 259,
"end": 260,
"ctxt": 0
},
"value": "G",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 267,
"end": 272,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 267,
"end": 268,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "TsEnumMember",
"span": {
"start": 278,
"end": 283,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 278,
"end": 279,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": 2.0
}
},
{
"type": "TsEnumMember",
"span": {
"start": 289,
"end": 298,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 289,
"end": 290,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 293,
"end": 298,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"value": "A",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "B",
"optional": false
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 304,
"end": 313,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 304,
"end": 305,
"ctxt": 0
},
"value": "D",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 308,
"end": 313,
"ctxt": 0
},
"operator": "*",
"left": {
"type": "Identifier",
"span": {
"start": 308,
"end": 309,
"ctxt": 0
},
"value": "A",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 312,
"end": 313,
"ctxt": 0
},
"value": 2.0
}
}
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 399,
"end": 409,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 403,
"end": 408,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 403,
"end": 404,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 407,
"end": 408,
"ctxt": 0
},
"value": "G",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 410,
"end": 426,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 414,
"end": 425,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 414,
"end": 416,
"ctxt": 0
},
"value": "z1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 419,
"end": 425,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 419,
"end": 420,
"ctxt": 0
},
"value": "G",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 420,
"end": 425,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 421,
"end": 424,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 421,
"end": 422,
"ctxt": 0
},
"value": "G",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 427,
"end": 436,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 431,
"end": 435,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 431,
"end": 432,
"ctxt": 0
},
"value": "g",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 432,
"end": 435,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"value": "G",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 437,
"end": 450,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 437,
"end": 449,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 437,
"end": 438,
"ctxt": 0
},
"value": "g",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 441,
"end": 449,
"ctxt": 0
},
"value": "string",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 460,
"end": 463,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 464,
"end": 468,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 464,
"end": 468,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 465,
"end": 468,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 467,
"end": 468,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 467,
"end": 468,
"ctxt": 0
},
"value": "G",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 451,
"end": 473,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 470,
"end": 473,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 474,
"end": 482,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 474,
"end": 481,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 474,
"end": 477,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 474,
"end": 475,
"ctxt": 0
},
"value": "G",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 476,
"end": 477,
"ctxt": 0
},
"value": "B",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 480,
"end": 481,
"ctxt": 0
},
"value": 3.0
}
}
}
],
"interpreter": null
}