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

283 lines
6.2 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 110,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 15,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 14,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 6,
"end": 14,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 8,
"end": 14,
"ctxt": 0
},
"kind": "object"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 16,
"end": 29,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 16,
"end": 28,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 16,
"end": 26,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 16,
"end": 17,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 18,
"end": 26,
"ctxt": 0
},
"value": "toString",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 30,
"end": 43,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 30,
"end": 42,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 30,
"end": 40,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 32,
"end": 40,
"ctxt": 0
},
"value": "nonExist",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 54,
"end": 80,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 58,
"end": 79,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 58,
"end": 75,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 60,
"end": 73,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 60,
"end": 73,
"ctxt": 0
},
"value": "destructuring",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "a",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 90,
"end": 110,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 94,
"end": 109,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 94,
"end": 105,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 96,
"end": 103,
"ctxt": 0
},
"rest": {
"start": 96,
"end": 99,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 99,
"end": 103,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"value": "a",
"optional": false
},
"definite": false
}
]
}
],
"interpreter": null
}