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

283 lines
6.2 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 109,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 14,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 13,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 5,
"end": 13,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 7,
"end": 13,
"ctxt": 0
},
"kind": "object"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 15,
"end": 28,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 15,
"end": 27,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 15,
"end": 25,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 17,
"end": 25,
"ctxt": 0
},
"value": "toString",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 29,
"end": 42,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 29,
"end": 41,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 29,
"end": 39,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 31,
"end": 39,
"ctxt": 0
},
"value": "nonExist",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 53,
"end": 79,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 57,
"end": 78,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 57,
"end": 74,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 59,
"end": 72,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 59,
"end": 72,
"ctxt": 0
},
"value": "destructuring",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "a",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 89,
"end": 109,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 93,
"end": 108,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 93,
"end": 104,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 95,
"end": 102,
"ctxt": 0
},
"rest": {
"start": 95,
"end": 98,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 98,
"end": 102,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "a",
"optional": false
},
"definite": false
}
]
}
],
"interpreter": null
}