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

347 lines
8.0 KiB
JSON

{
"type": "Script",
"span": {
"start": 85,
"end": 225,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 85,
"end": 115,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 99,
"end": 115,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 101,
"end": 113,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 101,
"end": 105,
"ctxt": 0
},
"value": "blub",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 105,
"end": 113,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 107,
"end": 113,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "EmptyStatement",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 126,
"end": 128,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 129,
"end": 138,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 129,
"end": 138,
"ctxt": 0
},
"value": "this",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 133,
"end": 138,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 135,
"end": 138,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 135,
"end": 138,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 117,
"end": 142,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 140,
"end": 142,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 144,
"end": 185,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 149,
"end": 153,
"ctxt": 0
},
"value": "Test",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 156,
"end": 184,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 156,
"end": 173,
"ctxt": 0
},
"value": "ThisParameterType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 173,
"end": 184,
"ctxt": 0
},
"params": [
{
"type": "TsTypeQuery",
"span": {
"start": 174,
"end": 183,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 181,
"end": 183,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"typeArguments": null
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 188,
"end": 225,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 194,
"end": 224,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 194,
"end": 196,
"ctxt": 0
},
"value": "fb",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 199,
"end": 224,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 199,
"end": 206,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 199,
"end": 201,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 202,
"end": 206,
"ctxt": 0
},
"value": "bind",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 207,
"end": 223,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 209,
"end": 213,
"ctxt": 0
},
"value": "blub",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 215,
"end": 221,
"ctxt": 0
},
"value": "blub",
"raw": "\"blub\""
}
}
]
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}