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

714 lines
19 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 16,
"end": 475,
"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": 63,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 35,
"end": 61,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 35,
"end": 46,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 47,
"end": 56,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 47,
"end": 56,
"ctxt": 0
},
"rest": {
"start": 47,
"end": 50,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 51,
"end": 56,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 53,
"end": 56,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 58,
"end": 61,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 25,
"end": 28,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 71,
"end": 85,
"ctxt": 0
},
"value": "SymbolIterator",
"optional": false
},
"declare": false,
"span": {
"start": 65,
"end": 243,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 92,
"end": 187,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 92,
"end": 96,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 92,
"end": 187,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 99,
"end": 187,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 109,
"end": 181,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 116,
"end": 180,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 130,
"end": 135,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 137,
"end": 145,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 137,
"end": 143,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 165,
"end": 170,
"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": 193,
"end": 241,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 193,
"end": 210,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 194,
"end": 209,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 194,
"end": 200,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 201,
"end": 209,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 193,
"end": 241,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 213,
"end": 241,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 223,
"end": 235,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 230,
"end": 234,
"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": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 251,
"end": 266,
"ctxt": 0
},
"value": "_StringIterator",
"optional": false
},
"declare": false,
"span": {
"start": 245,
"end": 418,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 273,
"end": 362,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 273,
"end": 277,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 273,
"end": 362,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 280,
"end": 362,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 290,
"end": 356,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 297,
"end": 355,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 311,
"end": 316,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 318,
"end": 320,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 334,
"end": 338,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 340,
"end": 345,
"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": 368,
"end": 416,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 368,
"end": 385,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 369,
"end": 384,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 369,
"end": 375,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 376,
"end": 384,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 368,
"end": 416,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 388,
"end": 416,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 398,
"end": 410,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 405,
"end": 409,
"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": 420,
"end": 475,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 420,
"end": 474,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 424,
"end": 427,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": [
{
"spread": {
"start": 428,
"end": 431,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 431,
"end": 449,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 435,
"end": 449,
"ctxt": 0
},
"value": "SymbolIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
}
},
{
"spread": {
"start": 451,
"end": 454,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 454,
"end": 473,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 458,
"end": 473,
"ctxt": 0
},
"value": "_StringIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}