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

363 lines
9.0 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 15,
"end": 246,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 21,
"end": 24,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 15,
"end": 28,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 35,
"end": 46,
"ctxt": 0
},
"value": "FooIterator",
"optional": false
},
"declare": false,
"span": {
"start": 29,
"end": 202,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 53,
"end": 147,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 53,
"end": 57,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 53,
"end": 147,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 60,
"end": 147,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 70,
"end": 141,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 77,
"end": 140,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 91,
"end": 96,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "NewExpression",
"span": {
"start": 98,
"end": 105,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 102,
"end": 105,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": null,
"typeArguments": null
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 119,
"end": 123,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 125,
"end": 130,
"ctxt": 0
},
"value": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 152,
"end": 200,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 152,
"end": 169,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 153,
"end": 168,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 153,
"end": 159,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 160,
"end": 168,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 152,
"end": 200,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 172,
"end": 200,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 182,
"end": 194,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 189,
"end": 193,
"ctxt": 0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 204,
"end": 206,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"value": "v",
"optional": false
}
},
{
"type": "ForOfStatement",
"span": {
"start": 207,
"end": 246,
"ctxt": 0
},
"await": null,
"left": {
"type": "VariableDeclaration",
"span": {
"start": 212,
"end": 217,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "NewExpression",
"span": {
"start": 221,
"end": 236,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 225,
"end": 236,
"ctxt": 0
},
"value": "FooIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 238,
"end": 246,
"ctxt": 0
},
"stmts": []
}
}
],
"interpreter": null
}