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

364 lines
9.1 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 16,
"end": 246,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 29,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 36,
"end": 47,
"ctxt": 0
},
"value": "FooIterator",
"optional": false
},
"declare": false,
"span": {
"start": 30,
"end": 203,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 54,
"end": 148,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 54,
"end": 58,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 54,
"end": 148,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 61,
"end": 148,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 71,
"end": 142,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 78,
"end": 141,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 92,
"end": 97,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "NewExpression",
"span": {
"start": 99,
"end": 106,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 103,
"end": 106,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": null,
"typeArguments": null
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 120,
"end": 124,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 126,
"end": 131,
"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": 153,
"end": 201,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 153,
"end": 170,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 154,
"end": 169,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 154,
"end": 160,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 161,
"end": 169,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 153,
"end": 201,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 173,
"end": 201,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 183,
"end": 195,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 190,
"end": 194,
"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": "ForOfStatement",
"span": {
"start": 205,
"end": 246,
"ctxt": 0
},
"await": null,
"left": {
"type": "VariableDeclaration",
"span": {
"start": 210,
"end": 215,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "NewExpression",
"span": {
"start": 219,
"end": 234,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 223,
"end": 234,
"ctxt": 0
},
"value": "FooIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 236,
"end": 246,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 242,
"end": 244,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": "v",
"optional": false
}
}
]
}
}
],
"interpreter": null
}