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

987 lines
27 KiB
JSON

{
"type": "Script",
"span": {
"start": 15,
"end": 362,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 15,
"end": 49,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 19,
"end": 49,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 19,
"end": 26,
"ctxt": 0
},
"value": "lambda1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 29,
"end": 49,
"ctxt": 0
},
"params": [
{
"type": "AssignmentPattern",
"span": {
"start": 30,
"end": 41,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 34,
"end": 41,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 46,
"end": 49,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 50,
"end": 95,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 54,
"end": 95,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 54,
"end": 61,
"ctxt": 0
},
"value": "lambda2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 64,
"end": 95,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 65,
"end": 74,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 66,
"end": 74,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 68,
"end": 74,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "AssignmentPattern",
"span": {
"start": 76,
"end": 87,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 80,
"end": 87,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 92,
"end": 95,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 96,
"end": 150,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 100,
"end": 150,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 100,
"end": 107,
"ctxt": 0
},
"value": "lambda3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 110,
"end": 150,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 111,
"end": 120,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 112,
"end": 120,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 114,
"end": 120,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "AssignmentPattern",
"span": {
"start": 122,
"end": 133,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 126,
"end": 133,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null
},
{
"type": "RestElement",
"span": {
"start": 138,
"end": 142,
"ctxt": 0
},
"rest": {
"start": 135,
"end": 138,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 138,
"end": 142,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 147,
"end": 150,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 151,
"end": 194,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 155,
"end": 194,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 155,
"end": 162,
"ctxt": 0
},
"value": "lambda4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 165,
"end": 194,
"ctxt": 0
},
"params": [
{
"type": "AssignmentPattern",
"span": {
"start": 166,
"end": 177,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 170,
"end": 177,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null
},
{
"type": "RestElement",
"span": {
"start": 182,
"end": 186,
"ctxt": 0
},
"rest": {
"start": 179,
"end": 182,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 182,
"end": 186,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 191,
"end": 194,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 196,
"end": 241,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 200,
"end": 241,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 214,
"end": 227,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 214,
"end": 227,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 214,
"end": 217,
"ctxt": 0
},
"value": "str",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 220,
"end": 227,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 229,
"end": 236,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 229,
"end": 236,
"ctxt": 0
},
"rest": {
"start": 229,
"end": 232,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 232,
"end": 236,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 204,
"end": 241,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 238,
"end": 241,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 242,
"end": 299,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 246,
"end": 299,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 246,
"end": 247,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 250,
"end": 299,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 250,
"end": 297,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 261,
"end": 269,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 261,
"end": 269,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 261,
"end": 264,
"ctxt": 0
},
"value": "num",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 267,
"end": 269,
"ctxt": 0
},
"value": 10.0
},
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 271,
"end": 282,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 271,
"end": 282,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 271,
"end": 274,
"ctxt": 0
},
"value": "boo",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 277,
"end": 282,
"ctxt": 0
},
"value": false
},
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 284,
"end": 291,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 284,
"end": 291,
"ctxt": 0
},
"rest": {
"start": 284,
"end": 287,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 287,
"end": 291,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 251,
"end": 296,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 293,
"end": 296,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 300,
"end": 362,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 304,
"end": 362,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 304,
"end": 305,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 308,
"end": 362,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 308,
"end": 358,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 319,
"end": 330,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 319,
"end": 330,
"ctxt": 0
},
"value": "num",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 322,
"end": 330,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 324,
"end": 330,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 332,
"end": 343,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 332,
"end": 343,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 332,
"end": 335,
"ctxt": 0
},
"value": "boo",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 338,
"end": 343,
"ctxt": 0
},
"value": false
},
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 345,
"end": 352,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 345,
"end": 352,
"ctxt": 0
},
"rest": {
"start": 345,
"end": 348,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 348,
"end": 352,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 309,
"end": 357,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 354,
"end": 357,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 359,
"end": 361,
"ctxt": 0
},
"value": 10.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}