swc/crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall.json

375 lines
9.5 KiB
JSON

{
"type": "Script",
"span": {
"start": 15,
"end": 250,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 24,
"end": 27,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 28,
"end": 37,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 28,
"end": 37,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 29,
"end": 37,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 31,
"end": 37,
"ctxt": 0
},
"kind": "symbol"
}
}
}
}
],
"decorators": [],
"span": {
"start": 15,
"end": 42,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 39,
"end": 42,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 49,
"end": 63,
"ctxt": 0
},
"value": "SymbolIterator",
"optional": false
},
"declare": false,
"span": {
"start": 43,
"end": 221,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 70,
"end": 165,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 70,
"end": 74,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 70,
"end": 165,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 77,
"end": 165,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 87,
"end": 159,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 94,
"end": 158,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 108,
"end": 113,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 115,
"end": 123,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 115,
"end": 121,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 137,
"end": 141,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 143,
"end": 148,
"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": 171,
"end": 219,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 171,
"end": 188,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 172,
"end": 187,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 172,
"end": 178,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 179,
"end": 187,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 171,
"end": 219,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 191,
"end": 219,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 201,
"end": 213,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 208,
"end": 212,
"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": 223,
"end": 250,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 223,
"end": 249,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 223,
"end": 226,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": {
"start": 227,
"end": 230,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 230,
"end": 248,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 234,
"end": 248,
"ctxt": 0
},
"value": "SymbolIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}