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

528 lines
13 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 15,
"end": 299,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 21,
"end": 24,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"declare": false,
"span": {
"start": 15,
"end": 30,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 37,
"end": 40,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 31,
"end": 58,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 49,
"end": 52,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 65,
"end": 76,
"ctxt": 0
},
"value": "FooIterator",
"optional": false
},
"declare": false,
"span": {
"start": 59,
"end": 233,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 83,
"end": 177,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 83,
"end": 87,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 83,
"end": 177,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 90,
"end": 177,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 100,
"end": 171,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 107,
"end": 170,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 121,
"end": 126,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "NewExpression",
"span": {
"start": 128,
"end": 135,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 132,
"end": 135,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": null,
"typeArguments": null
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 149,
"end": 153,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 155,
"end": 160,
"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": 183,
"end": 231,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 183,
"end": 200,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 184,
"end": 199,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 184,
"end": 190,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 191,
"end": 199,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 183,
"end": 231,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 203,
"end": 231,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 213,
"end": 225,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 220,
"end": 224,
"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": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 244,
"end": 247,
"ctxt": 0
},
"value": "fun",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 248,
"end": 272,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 248,
"end": 272,
"ctxt": 0
},
"left": {
"type": "ArrayPattern",
"span": {
"start": 248,
"end": 254,
"ctxt": 0
},
"elements": [
{
"type": "Identifier",
"span": {
"start": 249,
"end": 250,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 252,
"end": 253,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NewExpression",
"span": {
"start": 257,
"end": 272,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 261,
"end": 272,
"ctxt": 0
},
"value": "FooIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 235,
"end": 277,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 274,
"end": 277,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 278,
"end": 299,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 278,
"end": 298,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 278,
"end": 281,
"ctxt": 0
},
"value": "fun",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NewExpression",
"span": {
"start": 282,
"end": 297,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 286,
"end": 297,
"ctxt": 0
},
"value": "FooIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}