swc/crates/swc_ecma_parser/tests/tsc/for-inStatementsArrayErrors.json

636 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 25,
"end": 237,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 25,
"end": 39,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 29,
"end": 38,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 30,
"end": 38,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 32,
"end": 38,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 32,
"end": 36,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 32,
"end": 36,
"ctxt": 0
},
"value": "Date",
"optional": false
},
"typeParams": null
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForInStatement",
"span": {
"start": 41,
"end": 164,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 46,
"end": 51,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 58,
"end": 164,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 64,
"end": 82,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 68,
"end": 81,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 68,
"end": 70,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 73,
"end": 81,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 74,
"end": 81,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 75,
"end": 80,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": 1.0
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 87,
"end": 105,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 91,
"end": 104,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 91,
"end": 93,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 96,
"end": 104,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 97,
"end": 104,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 98,
"end": 103,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": 1.0
}
}
}
},
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 110,
"end": 130,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 114,
"end": 121,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": 1.0
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 123,
"end": 130,
"ctxt": 0
},
"stmts": []
},
"alternate": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 135,
"end": 162,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 139,
"end": 161,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 139,
"end": 141,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 144,
"end": 161,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 146,
"end": 161,
"ctxt": 0
},
"value": "unknownProperty",
"optional": false
}
},
"definite": false
}
]
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 166,
"end": 180,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 170,
"end": 179,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 171,
"end": 179,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 173,
"end": 179,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForInStatement",
"span": {
"start": 181,
"end": 202,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 186,
"end": 191,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 190,
"end": 191,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 190,
"end": 191,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 195,
"end": 196,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 199,
"end": 202,
"ctxt": 0
},
"stmts": []
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 204,
"end": 215,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 208,
"end": 214,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "j",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 209,
"end": 214,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 211,
"end": 214,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForInStatement",
"span": {
"start": 216,
"end": 237,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 221,
"end": 226,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "j",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 234,
"end": 237,
"ctxt": 0
},
"stmts": []
}
}
],
"interpreter": null
}