swc/crates/swc_ecma_parser/tests/tsc/parametersWithNoAnnotationAreAny.json
2022-02-04 20:17:42 +09:00

916 lines
23 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 344,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 9,
"end": 12,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 0,
"end": 29,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 16,
"end": 29,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 18,
"end": 27,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 25,
"end": 26,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 30,
"end": 67,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 34,
"end": 67,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": "f",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 47,
"end": 50,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 38,
"end": 67,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 54,
"end": 67,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 68,
"end": 86,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 72,
"end": 85,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"value": "f2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 77,
"end": 85,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "x",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 87,
"end": 108,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 91,
"end": 107,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 91,
"end": 93,
"ctxt": 0
},
"value": "f3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 96,
"end": 107,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "x",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 96,
"end": 99,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": null
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 110,
"end": 158,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 124,
"end": 156,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 124,
"end": 127,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 124,
"end": 156,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 131,
"end": 156,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 141,
"end": 150,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 160,
"end": 203,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 172,
"end": 203,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 178,
"end": 185,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 178,
"end": 181,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"typeAnn": null,
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
"start": 190,
"end": 201,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 190,
"end": 194,
"ctxt": 0
},
"value": "foo2",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 195,
"end": 196,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 198,
"end": 199,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
}
],
"typeAnn": null,
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 205,
"end": 227,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 209,
"end": 227,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 210,
"end": 227,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 212,
"end": 227,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 218,
"end": 225,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 218,
"end": 221,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"typeAnn": null,
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 229,
"end": 344,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 233,
"end": 344,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 237,
"end": 344,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 243,
"end": 246,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 243,
"end": 275,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 250,
"end": 275,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 260,
"end": 269,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 267,
"end": 268,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 293,
"end": 296,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 284,
"end": 325,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 300,
"end": 325,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 310,
"end": 319,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 334,
"end": 342,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 335,
"end": 336,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "Identifier",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"value": "x",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}