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

250 lines
5.6 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 15,
"end": 140,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 21,
"end": 35,
"ctxt": 0
},
"value": "StringIterator",
"optional": false
},
"declare": false,
"span": {
"start": 15,
"end": 89,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 42,
"end": 87,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 42,
"end": 59,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 43,
"end": 58,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 43,
"end": 49,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 50,
"end": 58,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 42,
"end": 87,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 62,
"end": 87,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 72,
"end": 81,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"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": 91,
"end": 102,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 95,
"end": 101,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 96,
"end": 101,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 98,
"end": 101,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 103,
"end": 140,
"ctxt": 0
},
"await": null,
"left": {
"type": "VariableDeclaration",
"span": {
"start": 108,
"end": 113,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "NewExpression",
"span": {
"start": 117,
"end": 135,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 121,
"end": 135,
"ctxt": 0
},
"value": "StringIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 137,
"end": 140,
"ctxt": 0
},
"stmts": []
}
}
],
"interpreter": null
}