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

487 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 24,
"end": 240,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 24,
"end": 67,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 34,
"end": 39,
"ctxt": 0
},
"value": "Flags",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 40,
"end": 67,
"ctxt": 0
},
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 43,
"end": 55,
"ctxt": 0
},
"value": "name",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 47,
"end": 55,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 49,
"end": 55,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 65,
"ctxt": 0
},
"kind": "boolean"
}
},
"readonly": false,
"static": false,
"span": {
"start": 42,
"end": 65,
"ctxt": 0
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 68,
"end": 85,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 72,
"end": 84,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 77,
"ctxt": 0
},
"value": "flags",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 77,
"end": 84,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 79,
"end": 84,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 79,
"end": 84,
"ctxt": 0
},
"value": "Flags",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 86,
"end": 94,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 86,
"end": 93,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 86,
"end": 91,
"ctxt": 0
},
"value": "flags",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 92,
"end": 93,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 95,
"end": 103,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 95,
"end": 102,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 95,
"end": 100,
"ctxt": 0
},
"value": "flags",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 101,
"end": 102,
"ctxt": 0
},
"value": "f",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 104,
"end": 137,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 104,
"end": 136,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 104,
"end": 109,
"ctxt": 0
},
"value": "flags",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 110,
"end": 136,
"ctxt": 0
},
"value": "isNotNecessarilyNeverFalse",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 138,
"end": 160,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 138,
"end": 159,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 138,
"end": 143,
"ctxt": 0
},
"value": "flags",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 143,
"end": 159,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 144,
"end": 158,
"ctxt": 0
},
"value": "this is fine",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 162,
"end": 181,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 172,
"end": 177,
"ctxt": 0
},
"value": "Empty",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 178,
"end": 181,
"ctxt": 0
},
"body": []
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 182,
"end": 199,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 186,
"end": 198,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 186,
"end": 191,
"ctxt": 0
},
"value": "empty",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 191,
"end": 198,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 193,
"end": 198,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 193,
"end": 198,
"ctxt": 0
},
"value": "Empty",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 200,
"end": 211,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 200,
"end": 210,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 200,
"end": 205,
"ctxt": 0
},
"value": "empty",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 206,
"end": 210,
"ctxt": 0
},
"value": "nope",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 212,
"end": 240,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 212,
"end": 239,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 212,
"end": 217,
"ctxt": 0
},
"value": "empty",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 217,
"end": 239,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 218,
"end": 238,
"ctxt": 0
},
"value": "not allowed either",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
}
],
"interpreter": null
}