swc/crates/swc_ecma_parser/tests/tsc/controlFlowDeleteOperator.json
2022-04-05 12:46:35 +00:00

728 lines
21 KiB
JSON

{
"type": "Script",
"span": {
"start": 28,
"end": 265,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 28,
"end": 265,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 41,
"end": 265,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 47,
"end": 109,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 51,
"end": 108,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 52,
"end": 97,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 54,
"end": 97,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 56,
"end": 76,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 58,
"end": 75,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 60,
"end": 75,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 60,
"end": 66,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 69,
"end": 75,
"ctxt": 0
},
"kind": "string"
}
]
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 77,
"end": 95,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 78,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 80,
"end": 95,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 80,
"end": 86,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 89,
"end": 95,
"ctxt": 0
},
"kind": "string"
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 100,
"end": 108,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 114,
"end": 118,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 114,
"end": 117,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 123,
"end": 127,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 123,
"end": 126,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 125,
"end": 126,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 132,
"end": 140,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 132,
"end": 139,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 132,
"end": 135,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 145,
"end": 153,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 145,
"end": 152,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 145,
"end": 148,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 145,
"end": 146,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 158,
"end": 162,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 158,
"end": 161,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 167,
"end": 171,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 167,
"end": 168,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 176,
"end": 187,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 176,
"end": 186,
"ctxt": 0
},
"operator": "delete",
"argument": {
"type": "MemberExpression",
"span": {
"start": 183,
"end": 186,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 183,
"end": 184,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 185,
"end": 186,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 192,
"end": 203,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 192,
"end": 202,
"ctxt": 0
},
"operator": "delete",
"argument": {
"type": "MemberExpression",
"span": {
"start": 199,
"end": 202,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 199,
"end": 200,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 208,
"end": 212,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 208,
"end": 211,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 217,
"end": 221,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 217,
"end": 220,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 219,
"end": 220,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 226,
"end": 228,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 233,
"end": 242,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 233,
"end": 241,
"ctxt": 0
},
"operator": "delete",
"argument": {
"type": "Identifier",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 261,
"end": 263,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}