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

628 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 249,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 23,
"end": 24,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 17,
"end": 139,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 31,
"end": 69,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 31,
"end": 42,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 43,
"end": 55,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 43,
"end": 55,
"ctxt": 0
},
"value": "name",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 47,
"end": 55,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 49,
"end": 55,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 57,
"end": 64,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 57,
"end": 64,
"ctxt": 0
},
"rest": {
"start": 57,
"end": 60,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 60,
"end": 64,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 75,
"end": 98,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 82,
"end": 85,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 86,
"end": 93,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 86,
"end": 93,
"ctxt": 0
},
"rest": {
"start": 86,
"end": 89,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 89,
"end": 93,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 75,
"end": 98,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 103,
"end": 137,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 110,
"end": 113,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 114,
"end": 123,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 114,
"end": 123,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 115,
"end": 123,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 117,
"end": 123,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 125,
"end": 132,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 125,
"end": 132,
"ctxt": 0
},
"rest": {
"start": 125,
"end": 128,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 128,
"end": 132,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 103,
"end": 137,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 141,
"end": 249,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 155,
"end": 179,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 155,
"end": 166,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 167,
"end": 174,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 167,
"end": 174,
"ctxt": 0
},
"rest": {
"start": 167,
"end": 170,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 170,
"end": 174,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 176,
"end": 179,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 185,
"end": 208,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 192,
"end": 195,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 196,
"end": 203,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 196,
"end": 203,
"ctxt": 0
},
"rest": {
"start": 196,
"end": 199,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 199,
"end": 203,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 185,
"end": 208,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 205,
"end": 208,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 213,
"end": 247,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 220,
"end": 223,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 224,
"end": 233,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 224,
"end": 233,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 225,
"end": 233,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 227,
"end": 233,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 235,
"end": 242,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 235,
"end": 242,
"ctxt": 0
},
"rest": {
"start": 235,
"end": 238,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 238,
"end": 242,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 213,
"end": 247,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 244,
"end": 247,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}