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

257 lines
7.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 95,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 16,
"end": 57,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 20,
"end": 57,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 20,
"end": 23,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 23,
"end": 57,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 25,
"end": 57,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 31,
"end": 55,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 31,
"end": 36,
"ctxt": 0
},
"value": "func1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 36,
"end": 55,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 38,
"end": 55,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 39,
"end": 46,
"ctxt": 0
},
"rest": {
"start": 39,
"end": 42,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 42,
"end": 46,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 48,
"end": 55,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 51,
"end": 55,
"ctxt": 0
},
"kind": "void"
}
}
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 59,
"end": 95,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 63,
"end": 95,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 63,
"end": 67,
"ctxt": 0
},
"value": "obj2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 70,
"end": 95,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 76,
"end": 80,
"ctxt": 0
},
"value": "func",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 81,
"end": 88,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 81,
"end": 88,
"ctxt": 0
},
"rest": {
"start": 81,
"end": 84,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 84,
"end": 88,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 76,
"end": 93,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}