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

771 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 376,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 15,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 14,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 9,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 9,
"end": 14,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 11,
"end": 14,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 56,
"end": 71,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 60,
"end": 70,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 60,
"end": 62,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 62,
"end": 70,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 64,
"end": 70,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 72,
"end": 85,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 72,
"end": 84,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "Identifier",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 79,
"end": 84,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 96,
"end": 99,
"ctxt": 0
},
"value": "fn1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 100,
"end": 110,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 100,
"end": 110,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 102,
"end": 110,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 104,
"end": 110,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 87,
"end": 133,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 112,
"end": 133,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 118,
"end": 131,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 118,
"end": 130,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "Identifier",
"span": {
"start": 118,
"end": 120,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 125,
"end": 130,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 156,
"end": 178,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 160,
"end": 177,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 160,
"end": 162,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 162,
"end": 177,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 164,
"end": 177,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 166,
"end": 175,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 167,
"end": 175,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 169,
"end": 175,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 179,
"end": 194,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 179,
"end": 193,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 179,
"end": 183,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 179,
"end": 181,
"ctxt": 0
},
"value": "x3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 188,
"end": 193,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 196,
"end": 214,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 196,
"end": 213,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 196,
"end": 203,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 196,
"end": 198,
"ctxt": 0
},
"value": "x3",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 198,
"end": 203,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 199,
"end": 202,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 208,
"end": 213,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 270,
"end": 285,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 270,
"end": 284,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "ParenthesisExpression",
"span": {
"start": 270,
"end": 274,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 271,
"end": 273,
"ctxt": 0
},
"value": "x1",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 279,
"end": 284,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 296,
"end": 299,
"ctxt": 0
},
"value": "fn2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 300,
"end": 310,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 300,
"end": 310,
"ctxt": 0
},
"value": "x4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 302,
"end": 310,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 304,
"end": 310,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 287,
"end": 335,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 312,
"end": 335,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 318,
"end": 333,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 318,
"end": 332,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "ParenthesisExpression",
"span": {
"start": 318,
"end": 322,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 319,
"end": 321,
"ctxt": 0
},
"value": "x4",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 327,
"end": 332,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 337,
"end": 354,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 337,
"end": 353,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "ParenthesisExpression",
"span": {
"start": 337,
"end": 343,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 338,
"end": 342,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 338,
"end": 340,
"ctxt": 0
},
"value": "x3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 348,
"end": 353,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 356,
"end": 376,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 356,
"end": 375,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "ParenthesisExpression",
"span": {
"start": 356,
"end": 365,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 357,
"end": 364,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 357,
"end": 359,
"ctxt": 0
},
"value": "x3",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 359,
"end": 364,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 360,
"end": 363,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 370,
"end": 375,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
}
],
"interpreter": null
}