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

257 lines
7.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 96,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 17,
"end": 58,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 21,
"end": 58,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 21,
"end": 24,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 24,
"end": 58,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 26,
"end": 58,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 32,
"end": 56,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 32,
"end": 37,
"ctxt": 0
},
"value": "func1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 37,
"end": 56,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 39,
"end": 56,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 40,
"end": 47,
"ctxt": 0
},
"rest": {
"start": 40,
"end": 43,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 43,
"end": 47,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 49,
"end": 56,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 52,
"end": 56,
"ctxt": 0
},
"kind": "void"
}
}
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 60,
"end": 96,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 64,
"end": 96,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 64,
"end": 68,
"ctxt": 0
},
"value": "obj2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 71,
"end": 96,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 77,
"end": 81,
"ctxt": 0
},
"value": "func",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"rest": {
"start": 82,
"end": 85,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 85,
"end": 89,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 77,
"end": 94,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 91,
"end": 94,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}