swc/crates/swc_ecma_parser/tests/tsc/propertyAccessChain.2.json

609 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 20,
"end": 195,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 20,
"end": 64,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 34,
"end": 63,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 34,
"end": 36,
"ctxt": 0
},
"value": "o1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 36,
"end": 63,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 38,
"end": 63,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 38,
"end": 47,
"ctxt": 0
},
"kind": "undefined"
},
{
"type": "TsTypeLiteral",
"span": {
"start": 50,
"end": 63,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 52,
"end": 61,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 61,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 55,
"end": 61,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 65,
"end": 71,
"ctxt": 0
},
"expression": {
"type": "OptionalChainingExpression",
"span": {
"start": 65,
"end": 70,
"ctxt": 0
},
"questionDotToken": {
"start": 67,
"end": 68,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 65,
"end": 70,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 65,
"end": 67,
"ctxt": 0
},
"value": "o1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 73,
"end": 124,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 87,
"end": 123,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 87,
"end": 89,
"ctxt": 0
},
"value": "o2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 89,
"end": 123,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 91,
"end": 123,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 91,
"end": 100,
"ctxt": 0
},
"kind": "undefined"
},
{
"type": "TsTypeLiteral",
"span": {
"start": 103,
"end": 123,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 105,
"end": 121,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 106,
"end": 121,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 108,
"end": 121,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 110,
"end": 119,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 110,
"end": 111,
"ctxt": 0
},
"value": "c",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 111,
"end": 119,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 113,
"end": 119,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 125,
"end": 133,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 125,
"end": 132,
"ctxt": 0
},
"object": {
"type": "OptionalChainingExpression",
"span": {
"start": 125,
"end": 130,
"ctxt": 0
},
"questionDotToken": {
"start": 127,
"end": 128,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 125,
"end": 130,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"value": "o2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "c",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 135,
"end": 186,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 149,
"end": 185,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 149,
"end": 151,
"ctxt": 0
},
"value": "o3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 151,
"end": 185,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 153,
"end": 185,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 155,
"end": 183,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 155,
"end": 156,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 156,
"end": 183,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 158,
"end": 183,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 158,
"end": 167,
"ctxt": 0
},
"kind": "undefined"
},
{
"type": "TsTypeLiteral",
"span": {
"start": 170,
"end": 183,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 172,
"end": 181,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "c",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 173,
"end": 181,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 175,
"end": 181,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 187,
"end": 195,
"ctxt": 0
},
"expression": {
"type": "OptionalChainingExpression",
"span": {
"start": 187,
"end": 194,
"ctxt": 0
},
"questionDotToken": {
"start": 191,
"end": 192,
"ctxt": 0
},
"base": {
"type": "MemberExpression",
"span": {
"start": 187,
"end": 194,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 187,
"end": 191,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 187,
"end": 189,
"ctxt": 0
},
"value": "o3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 190,
"end": 191,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": "c",
"optional": false
}
}
}
}
],
"interpreter": null
}