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

937 lines
25 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 16,
"end": 357,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 256,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 30,
"end": 92,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 30,
"end": 41,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 42,
"end": 52,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 42,
"end": 52,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 43,
"end": 52,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 45,
"end": 52,
"ctxt": 0
},
"kind": "boolean"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 54,
"end": 63,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 54,
"end": 63,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 55,
"end": 63,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 57,
"end": 63,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 65,
"end": 74,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 65,
"end": 74,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 66,
"end": 74,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 68,
"end": 74,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 76,
"end": 87,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 76,
"end": 87,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 80,
"end": 87,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 89,
"end": 92,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 98,
"end": 134,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 105,
"end": 108,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 118,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 120,
"end": 129,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 120,
"end": 129,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 124,
"end": 129,
"ctxt": 0
},
"value": false
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 98,
"end": 134,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 131,
"end": 134,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 139,
"end": 185,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 146,
"end": 150,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 151,
"end": 160,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 151,
"end": 160,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 154,
"end": 160,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 162,
"end": 171,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 162,
"end": 171,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 166,
"end": 171,
"ctxt": 0
},
"value": false
},
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 173,
"end": 180,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 173,
"end": 180,
"ctxt": 0
},
"rest": {
"start": 173,
"end": 176,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 176,
"end": 180,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 139,
"end": 185,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 182,
"end": 185,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 190,
"end": 215,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 197,
"end": 200,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 201,
"end": 210,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 201,
"end": 210,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 205,
"end": 210,
"ctxt": 0
},
"value": false
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 190,
"end": 215,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 212,
"end": 215,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 220,
"end": 254,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 227,
"end": 230,
"ctxt": 0
},
"value": "boo",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 231,
"end": 240,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 231,
"end": 240,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 235,
"end": 240,
"ctxt": 0
},
"value": false
},
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 242,
"end": 249,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 242,
"end": 249,
"ctxt": 0
},
"rest": {
"start": 242,
"end": 245,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 245,
"end": 249,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 220,
"end": 254,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 251,
"end": 254,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 258,
"end": 302,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 272,
"end": 300,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 272,
"end": 283,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 284,
"end": 295,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 284,
"end": 295,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 284,
"end": 285,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 288,
"end": 295,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 297,
"end": 300,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 310,
"end": 311,
"ctxt": 0
},
"value": "E",
"optional": false
},
"declare": false,
"span": {
"start": 304,
"end": 357,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 318,
"end": 355,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 318,
"end": 329,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 330,
"end": 341,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 330,
"end": 341,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 334,
"end": 341,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 343,
"end": 350,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 343,
"end": 350,
"ctxt": 0
},
"rest": {
"start": 343,
"end": 346,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 346,
"end": 350,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 352,
"end": 355,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}