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

1258 lines
33 KiB
JSON

{
"type": "Script",
"span": {
"start": 41,
"end": 537,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 50,
"end": 52,
"ctxt": 0
},
"value": "f0",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 53,
"end": 62,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 53,
"end": 62,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 54,
"end": 62,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 64,
"end": 73,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 64,
"end": 73,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 65,
"end": 73,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 67,
"end": 73,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 41,
"end": 120,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 75,
"end": 120,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 81,
"end": 90,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 81,
"end": 89,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 81,
"end": 83,
"ctxt": 0
},
"value": "f0",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 95,
"end": 104,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 95,
"end": 103,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 95,
"end": 97,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 101,
"end": 102,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 109,
"end": 117,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 109,
"end": 111,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 131,
"end": 133,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 134,
"end": 160,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 134,
"end": 160,
"ctxt": 0
},
"rest": {
"start": 134,
"end": 137,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 137,
"end": 141,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 141,
"end": 160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
"start": 143,
"end": 160,
"ctxt": 0
},
"op": "readonly",
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 152,
"end": 160,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 152,
"end": 158,
"ctxt": 0
},
"kind": "string"
}
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 122,
"end": 255,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 162,
"end": 255,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 168,
"end": 180,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 168,
"end": 179,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 168,
"end": 170,
"ctxt": 0
},
"value": "f0",
"optional": false
},
"arguments": [
{
"spread": {
"start": 171,
"end": 174,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 174,
"end": 178,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 195,
"end": 212,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 195,
"end": 211,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 195,
"end": 197,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 198,
"end": 203,
"ctxt": 0
},
"value": "abc",
"raw": "'abc'"
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 205,
"end": 210,
"ctxt": 0
},
"value": "def",
"raw": "'def'"
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 217,
"end": 236,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 217,
"end": 235,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 217,
"end": 219,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 220,
"end": 225,
"ctxt": 0
},
"value": "abc",
"raw": "'abc'"
}
},
{
"spread": {
"start": 227,
"end": 230,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 230,
"end": 234,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 241,
"end": 253,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 241,
"end": 252,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 241,
"end": 243,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": {
"start": 244,
"end": 247,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 247,
"end": 251,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 266,
"end": 268,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 269,
"end": 303,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 269,
"end": 303,
"ctxt": 0
},
"rest": {
"start": 269,
"end": 272,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 272,
"end": 276,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 276,
"end": 303,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
"start": 278,
"end": 303,
"ctxt": 0
},
"op": "readonly",
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 287,
"end": 303,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 288,
"end": 294,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 288,
"end": 294,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 296,
"end": 302,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 296,
"end": 302,
"ctxt": 0
},
"kind": "string"
}
}
]
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 257,
"end": 461,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 305,
"end": 461,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 311,
"end": 323,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 311,
"end": 322,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 311,
"end": 313,
"ctxt": 0
},
"value": "f0",
"optional": false
},
"arguments": [
{
"spread": {
"start": 314,
"end": 317,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 317,
"end": 321,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 328,
"end": 345,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 328,
"end": 344,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 328,
"end": 330,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 331,
"end": 336,
"ctxt": 0
},
"value": "abc",
"raw": "'abc'"
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 338,
"end": 343,
"ctxt": 0
},
"value": "def",
"raw": "'def'"
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 350,
"end": 369,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 350,
"end": 368,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 350,
"end": 352,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 353,
"end": 358,
"ctxt": 0
},
"value": "abc",
"raw": "'abc'"
}
},
{
"spread": {
"start": 360,
"end": 363,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 363,
"end": 367,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 374,
"end": 386,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 374,
"end": 385,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 374,
"end": 376,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": {
"start": 377,
"end": 380,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 380,
"end": 384,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 391,
"end": 408,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 391,
"end": 407,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 391,
"end": 393,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 394,
"end": 399,
"ctxt": 0
},
"value": "abc",
"raw": "'abc'"
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 401,
"end": 406,
"ctxt": 0
},
"value": "def",
"raw": "'def'"
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 413,
"end": 432,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 413,
"end": 431,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 413,
"end": 415,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 416,
"end": 421,
"ctxt": 0
},
"value": "abc",
"raw": "'abc'"
}
},
{
"spread": {
"start": 423,
"end": 426,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 426,
"end": 430,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 447,
"end": 459,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 447,
"end": 458,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 447,
"end": 449,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": {
"start": 450,
"end": 453,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 453,
"end": 457,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 472,
"end": 474,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 475,
"end": 501,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 475,
"end": 501,
"ctxt": 0
},
"rest": {
"start": 475,
"end": 478,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 478,
"end": 482,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 482,
"end": 501,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
"start": 484,
"end": 501,
"ctxt": 0
},
"op": "readonly",
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 493,
"end": 501,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 493,
"end": 499,
"ctxt": 0
},
"kind": "string"
}
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 463,
"end": 537,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 503,
"end": 537,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 509,
"end": 525,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 509,
"end": 524,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 509,
"end": 516,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 509,
"end": 513,
"ctxt": 0
},
"value": "args",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 513,
"end": 516,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 514,
"end": 515,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 519,
"end": 524,
"ctxt": 0
},
"value": "abc",
"raw": "'abc'"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}