swc/crates/swc_ecma_parser/tests/tsc/ES5For-of37.json
2023-03-12 04:50:28 +00:00

524 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 87,
"end": 430,
"ctxt": 0
},
"body": [
{
"type": "ForOfStatement",
"span": {
"start": 87,
"end": 430,
"ctxt": 0
},
"await": false,
"left": {
"type": "VariableDeclaration",
"span": {
"start": 92,
"end": 99,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 103,
"end": 118,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 110,
"end": 111,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": 4.0,
"raw": "4"
}
}
]
},
"body": {
"type": "BlockStatement",
"span": {
"start": 120,
"end": 430,
"ctxt": 0
},
"stmts": [
{
"type": "TryStatement",
"span": {
"start": 126,
"end": 428,
"ctxt": 0
},
"block": {
"type": "BlockStatement",
"span": {
"start": 130,
"end": 368,
"ctxt": 0
},
"stmts": [
{
"type": "ForOfStatement",
"span": {
"start": 219,
"end": 338,
"ctxt": 0
},
"await": false,
"left": {
"type": "VariableDeclaration",
"span": {
"start": 224,
"end": 231,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "j",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 235,
"end": 244,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 239,
"end": 240,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
}
]
},
"body": {
"type": "BlockStatement",
"span": {
"start": 246,
"end": 338,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 260,
"end": 328,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 264,
"end": 271,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "i",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 270,
"end": 271,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 273,
"end": 328,
"ctxt": 0
},
"stmts": [
{
"type": "ThrowStatement",
"span": {
"start": 291,
"end": 314,
"ctxt": 0
},
"argument": {
"type": "NewExpression",
"span": {
"start": 297,
"end": 313,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 301,
"end": 306,
"ctxt": 0
},
"value": "Error",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 307,
"end": 312,
"ctxt": 0
},
"value": "ERR",
"raw": "'ERR'"
}
}
],
"typeArguments": null
}
}
]
},
"alternate": null
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 347,
"end": 362,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 347,
"end": 361,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 347,
"end": 358,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 347,
"end": 354,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 355,
"end": 358,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 359,
"end": 360,
"ctxt": 0
},
"value": "i",
"optional": false
}
}
],
"typeArguments": null
}
}
]
},
"handler": {
"type": "CatchClause",
"span": {
"start": 369,
"end": 428,
"ctxt": 0
},
"param": {
"type": "Identifier",
"span": {
"start": 376,
"end": 379,
"ctxt": 0
},
"value": "err",
"optional": false,
"typeAnnotation": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 381,
"end": 428,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 391,
"end": 422,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 391,
"end": 421,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 391,
"end": 402,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 391,
"end": 398,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 399,
"end": 402,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 403,
"end": 412,
"ctxt": 0
},
"value": "E %s %s",
"raw": "'E %s %s'"
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 414,
"end": 415,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 417,
"end": 420,
"ctxt": 0
},
"value": "err",
"optional": false
}
}
],
"typeArguments": null
}
}
]
}
},
"finalizer": null
}
]
}
}
],
"interpreter": null
}