swc/crates/swc_ecma_parser/tests/tsc/constructorParameterShadowsOuterScopes.json
2022-03-22 07:54:08 +00:00

439 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 402,
"end": 729,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 402,
"end": 412,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 406,
"end": 411,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 410,
"end": 411,
"ctxt": 0
},
"value": 1.0
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 419,
"end": 420,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 413,
"end": 575,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 427,
"end": 433,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 427,
"end": 428,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 431,
"end": 432,
"ctxt": 0
},
"value": "x",
"optional": false
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 502,
"end": 569,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 502,
"end": 513,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 514,
"end": 523,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 514,
"end": 523,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 515,
"end": 523,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 517,
"end": 523,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 525,
"end": 569,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 535,
"end": 541,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 535,
"end": 540,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 535,
"end": 536,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 539,
"end": 540,
"ctxt": 0
},
"value": 2.0
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 577,
"end": 587,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 581,
"end": 586,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 581,
"end": 582,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 585,
"end": 586,
"ctxt": 0
},
"value": 1.0
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 594,
"end": 595,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 588,
"end": 729,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 602,
"end": 608,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 602,
"end": 603,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 606,
"end": 607,
"ctxt": 0
},
"value": "y",
"optional": false
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 677,
"end": 727,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 677,
"end": 688,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 689,
"end": 698,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 689,
"end": 698,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 690,
"end": 698,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 692,
"end": 698,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 700,
"end": 727,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 710,
"end": 721,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 714,
"end": 720,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 714,
"end": 715,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 718,
"end": 720,
"ctxt": 0
},
"value": "",
"raw": "\"\""
},
"definite": false
}
]
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}