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

655 lines
17 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 16,
"end": 333,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 31,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"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": 38,
"end": 41,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 32,
"end": 59,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 56,
"end": 57,
"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": 50,
"end": 53,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 66,
"end": 82,
"ctxt": 0
},
"value": "FooArrayIterator",
"optional": false
},
"declare": false,
"span": {
"start": 60,
"end": 241,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 89,
"end": 185,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 89,
"end": 93,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 89,
"end": 185,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 96,
"end": 185,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 106,
"end": 179,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 113,
"end": 178,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 127,
"end": 132,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "ArrayExpression",
"span": {
"start": 134,
"end": 143,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NewExpression",
"span": {
"start": 135,
"end": 142,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 139,
"end": 142,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
]
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 157,
"end": 161,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 163,
"end": 168,
"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": 191,
"end": 239,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 191,
"end": 208,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 192,
"end": 207,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 192,
"end": 198,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 199,
"end": 207,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 191,
"end": 239,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 211,
"end": 239,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 221,
"end": 233,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 228,
"end": 232,
"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": 252,
"end": 255,
"ctxt": 0
},
"value": "fun",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 256,
"end": 298,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 256,
"end": 298,
"ctxt": 0
},
"rest": {
"start": 256,
"end": 259,
"ctxt": 0
},
"argument": {
"type": "ArrayPattern",
"span": {
"start": 259,
"end": 289,
"ctxt": 0
},
"elements": [
{
"type": "ArrayPattern",
"span": {
"start": 260,
"end": 273,
"ctxt": 0
},
"elements": [
{
"type": "AssignmentPattern",
"span": {
"start": 261,
"end": 272,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NewExpression",
"span": {
"start": 265,
"end": 272,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 269,
"end": 272,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
{
"type": "AssignmentPattern",
"span": {
"start": 275,
"end": 288,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 275,
"end": 276,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 279,
"end": 288,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NewExpression",
"span": {
"start": 280,
"end": 287,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 284,
"end": 287,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
]
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 289,
"end": 298,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 291,
"end": 298,
"ctxt": 0
},
"elemType": {
"type": "TsArrayType",
"span": {
"start": 291,
"end": 296,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 291,
"end": 294,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 291,
"end": 294,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"typeParams": null
}
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 243,
"end": 303,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 300,
"end": 303,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 304,
"end": 333,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 304,
"end": 332,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 304,
"end": 307,
"ctxt": 0
},
"value": "fun",
"optional": false
},
"arguments": [
{
"spread": {
"start": 308,
"end": 311,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 311,
"end": 331,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 315,
"end": 331,
"ctxt": 0
},
"value": "FooArrayIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}