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

540 lines
12 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 155,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 6,
"end": 7,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 0,
"end": 70,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 22,
"end": 31,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 23,
"end": 31,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 25,
"end": 31,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 32,
"end": 40,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 34,
"end": 40,
"ctxt": 0
},
"kind": "number"
}
},
"readonly": false,
"static": true,
"span": {
"start": 14,
"end": 41,
"ctxt": 0
}
},
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 54,
"end": 63,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 55,
"end": 63,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 57,
"end": 63,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 64,
"end": 68,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 66,
"end": 68,
"ctxt": 0
},
"literal": {
"type": "NumericLiteral",
"span": {
"start": 66,
"end": 68,
"ctxt": 0
},
"value": 42.0
}
}
},
"readonly": false,
"static": true,
"span": {
"start": 46,
"end": 68,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 72,
"end": 84,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 72,
"end": 84,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 72,
"end": 80,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 73,
"end": 80,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 74,
"end": 79,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 85,
"end": 95,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 85,
"end": 94,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 85,
"end": 90,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 87,
"end": 90,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": 2.0
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 96,
"end": 116,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 102,
"end": 116,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 102,
"end": 105,
"ctxt": 0
},
"value": "foo",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 108,
"end": 116,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 109,
"end": 116,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 110,
"end": 115,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 117,
"end": 127,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 117,
"end": 127,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 117,
"end": 122,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 118,
"end": 122,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 119,
"end": 121,
"ctxt": 0
},
"value": 42.0
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"value": 42.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 128,
"end": 137,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 128,
"end": 136,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 128,
"end": 132,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 129,
"end": 132,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": 2.0
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": 2.0
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 138,
"end": 155,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 144,
"end": 155,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 144,
"end": 147,
"ctxt": 0
},
"value": "bar",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 150,
"end": 155,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 151,
"end": 155,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 152,
"end": 154,
"ctxt": 0
},
"value": 42.0
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}