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

275 lines
6.0 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 193,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 36,
"ctxt": 0
},
"value": "StringIterator",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 93,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 43,
"end": 91,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 43,
"end": 60,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 44,
"end": 59,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 44,
"end": 50,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 51,
"end": 59,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 43,
"end": 91,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 63,
"end": 91,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 73,
"end": 85,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 80,
"end": 84,
"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": "VariableDeclaration",
"span": {
"start": 95,
"end": 109,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 99,
"end": 108,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 100,
"end": 108,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 102,
"end": 108,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 110,
"end": 143,
"ctxt": 0
},
"await": null,
"left": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NewExpression",
"span": {
"start": 120,
"end": 138,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 124,
"end": 138,
"ctxt": 0
},
"value": "StringIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 140,
"end": 143,
"ctxt": 0
},
"stmts": []
}
},
{
"type": "ForOfStatement",
"span": {
"start": 160,
"end": 193,
"ctxt": 0
},
"await": null,
"left": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NewExpression",
"span": {
"start": 170,
"end": 188,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 174,
"end": 188,
"ctxt": 0
},
"value": "StringIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 190,
"end": 193,
"ctxt": 0
},
"stmts": []
}
}
],
"interpreter": null
}