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

1297 lines
34 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 40,
"end": 536,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 49,
"end": 51,
"ctxt": 0
},
"value": "f0",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 52,
"end": 61,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 52,
"end": 61,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 61,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 55,
"end": 61,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 63,
"end": 72,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 63,
"end": 72,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 64,
"end": 72,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 66,
"end": 72,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 40,
"end": 119,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 74,
"end": 119,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 80,
"end": 89,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 80,
"end": 88,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 80,
"end": 82,
"ctxt": 0
},
"value": "f0",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 94,
"end": 103,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 94,
"end": 102,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 94,
"end": 96,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 108,
"end": 117,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 108,
"end": 116,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 108,
"end": 110,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 130,
"end": 132,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 133,
"end": 159,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 133,
"end": 159,
"ctxt": 0
},
"rest": {
"start": 133,
"end": 136,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 136,
"end": 140,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 140,
"end": 159,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
"start": 142,
"end": 159,
"ctxt": 0
},
"op": "readonly",
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 151,
"end": 159,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 151,
"end": 157,
"ctxt": 0
},
"kind": "string"
}
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 121,
"end": 254,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 161,
"end": 254,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 167,
"end": 179,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 167,
"end": 178,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 167,
"end": 169,
"ctxt": 0
},
"value": "f0",
"optional": false
},
"arguments": [
{
"spread": {
"start": 170,
"end": 173,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 173,
"end": 177,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 194,
"end": 211,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 194,
"end": 210,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 194,
"end": 196,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 197,
"end": 202,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 204,
"end": 209,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 216,
"end": 235,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 216,
"end": 234,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 216,
"end": 218,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 219,
"end": 224,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": {
"start": 226,
"end": 229,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 229,
"end": 233,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 240,
"end": 252,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 240,
"end": 251,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": {
"start": 243,
"end": 246,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 246,
"end": 250,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 265,
"end": 267,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 268,
"end": 302,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 268,
"end": 302,
"ctxt": 0
},
"rest": {
"start": 268,
"end": 271,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 271,
"end": 275,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 275,
"end": 302,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
"start": 277,
"end": 302,
"ctxt": 0
},
"op": "readonly",
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 286,
"end": 302,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 287,
"end": 293,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 287,
"end": 293,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 295,
"end": 301,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 295,
"end": 301,
"ctxt": 0
},
"kind": "string"
}
}
]
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 256,
"end": 460,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 304,
"end": 460,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 310,
"end": 322,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 310,
"end": 321,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 310,
"end": 312,
"ctxt": 0
},
"value": "f0",
"optional": false
},
"arguments": [
{
"spread": {
"start": 313,
"end": 316,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 316,
"end": 320,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 327,
"end": 344,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 327,
"end": 343,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 327,
"end": 329,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 330,
"end": 335,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 337,
"end": 342,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 349,
"end": 368,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 349,
"end": 367,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 349,
"end": 351,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 352,
"end": 357,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": {
"start": 359,
"end": 362,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 362,
"end": 366,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 373,
"end": 385,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 373,
"end": 384,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 373,
"end": 375,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": {
"start": 376,
"end": 379,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 379,
"end": 383,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 390,
"end": 407,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 390,
"end": 406,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 390,
"end": 392,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 393,
"end": 398,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 400,
"end": 405,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 412,
"end": 431,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 412,
"end": 430,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 412,
"end": 414,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 415,
"end": 420,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"spread": {
"start": 422,
"end": 425,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 425,
"end": 429,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 446,
"end": 458,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 446,
"end": 457,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 446,
"end": 448,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": {
"start": 449,
"end": 452,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 452,
"end": 456,
"ctxt": 0
},
"value": "args",
"optional": false
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 471,
"end": 473,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 474,
"end": 500,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 474,
"end": 500,
"ctxt": 0
},
"rest": {
"start": 474,
"end": 477,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 477,
"end": 481,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 481,
"end": 500,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
"start": 483,
"end": 500,
"ctxt": 0
},
"op": "readonly",
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 492,
"end": 500,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 492,
"end": 498,
"ctxt": 0
},
"kind": "string"
}
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 462,
"end": 536,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 502,
"end": 536,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 508,
"end": 524,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 508,
"end": 523,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 508,
"end": 515,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 508,
"end": 512,
"ctxt": 0
},
"value": "args",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 512,
"end": 515,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 513,
"end": 514,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 518,
"end": 523,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}