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

558 lines
17 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 199,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 16,
"end": 199,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 20,
"end": 199,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 20,
"end": 24,
"ctxt": 0
},
"value": "obj2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 27,
"end": 199,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 33,
"end": 38,
"ctxt": 0
},
"value": "func1",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 39,
"end": 45,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 39,
"end": 45,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 43,
"end": 45,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
},
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 47,
"end": 54,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 47,
"end": 54,
"ctxt": 0
},
"rest": {
"start": 47,
"end": 50,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 50,
"end": 54,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 33,
"end": 59,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 56,
"end": 59,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 65,
"end": 70,
"ctxt": 0
},
"value": "func2",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 71,
"end": 82,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 71,
"end": 82,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 75,
"end": 82,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 65,
"end": 87,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 93,
"end": 98,
"ctxt": 0
},
"value": "func3",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 99,
"end": 108,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 99,
"end": 108,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 100,
"end": 108,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 102,
"end": 108,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 110,
"end": 119,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 110,
"end": 119,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 111,
"end": 119,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 113,
"end": 119,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 121,
"end": 132,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 121,
"end": 132,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 125,
"end": 132,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 93,
"end": 137,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 143,
"end": 148,
"ctxt": 0
},
"value": "func4",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 149,
"end": 158,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 149,
"end": 158,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 150,
"end": 158,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 152,
"end": 158,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 160,
"end": 169,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 160,
"end": 169,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 161,
"end": 169,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 163,
"end": 169,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 171,
"end": 182,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 171,
"end": 182,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 175,
"end": 182,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
},
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 184,
"end": 191,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 184,
"end": 191,
"ctxt": 0
},
"rest": {
"start": 184,
"end": 187,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 187,
"end": 191,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 143,
"end": 196,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 193,
"end": 196,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}