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

351 lines
8.2 KiB
JSON

{
"type": "Script",
"span": {
"start": 84,
"end": 224,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 84,
"end": 114,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 97,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 98,
"end": 114,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 100,
"end": 112,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 100,
"end": 104,
"ctxt": 0
},
"value": "blub",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 104,
"end": 112,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 106,
"end": 112,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "EmptyStatement",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 128,
"end": 137,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 128,
"end": 137,
"ctxt": 0
},
"value": "this",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 132,
"end": 137,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 116,
"end": 141,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 139,
"end": 141,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 143,
"end": 184,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 148,
"end": 152,
"ctxt": 0
},
"value": "Test",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 155,
"end": 183,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 155,
"end": 172,
"ctxt": 0
},
"value": "ThisParameterType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 172,
"end": 183,
"ctxt": 0
},
"params": [
{
"type": "TsTypeQuery",
"span": {
"start": 173,
"end": 182,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 180,
"end": 182,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"typeArguments": null
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 187,
"end": 224,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 193,
"end": 223,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 193,
"end": 195,
"ctxt": 0
},
"value": "fb",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 198,
"end": 223,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 198,
"end": 205,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 198,
"end": 200,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 201,
"end": 205,
"ctxt": 0
},
"value": "bind",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 206,
"end": 222,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 208,
"end": 212,
"ctxt": 0
},
"value": "blub",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 214,
"end": 220,
"ctxt": 0
},
"value": "blub",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}