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

480 lines
12 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 15,
"end": 265,
"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": 31,
"end": 40,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 31,
"end": 40,
"ctxt": 0
},
"rest": {
"start": 31,
"end": 34,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 35,
"end": 40,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 37,
"end": 40,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 15,
"end": 57,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 42,
"end": 57,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 44,
"end": 55,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 51,
"end": 55,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"value": "s",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 52,
"end": 55,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": 0.0
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 27,
"end": 30,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 64,
"end": 78,
"ctxt": 0
},
"value": "SymbolIterator",
"optional": false
},
"declare": false,
"span": {
"start": 58,
"end": 236,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 85,
"end": 180,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 85,
"end": 89,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 85,
"end": 180,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 92,
"end": 180,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 102,
"end": 174,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 109,
"end": 173,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 123,
"end": 128,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 130,
"end": 138,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 130,
"end": 136,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 152,
"end": 156,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 158,
"end": 163,
"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": 186,
"end": 234,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 186,
"end": 203,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 187,
"end": 202,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 187,
"end": 193,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 194,
"end": 202,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 186,
"end": 234,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 206,
"end": 234,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 216,
"end": 228,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 223,
"end": 227,
"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": 238,
"end": 265,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 238,
"end": 264,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 238,
"end": 241,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": {
"start": 242,
"end": 245,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 245,
"end": 263,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 249,
"end": 263,
"ctxt": 0
},
"value": "SymbolIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}