---
source: crates/react_hermes_parser/tests/parser_test.rs
expression: "format!(\"Input:\\n{input}\\n\\nOutput:\\n{output}\")"
input_file: crates/react_hermes_parser/tests/fixtures/capturing-nested-member-expr.js
---
Input:
function component(a) {
  let z = { a: { a } };
  let x = function () {
    console.log(z.a.a);
  };
  return x;
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "component",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          18
        ]
      },
      "params": [
        {
          "type": "Identifier",
          "name": "a",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            19,
            20
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "z",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    30,
                    31
                  ]
                },
                "init": {
                  "type": "ObjectExpression",
                  "properties": [
                    {
                      "type": "Property",
                      "key": {
                        "type": "Identifier",
                        "name": "a",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          36,
                          37
                        ]
                      },
                      "value": {
                        "type": "ObjectExpression",
                        "properties": [
                          {
                            "type": "Property",
                            "key": {
                              "type": "Identifier",
                              "name": "a",
                              "typeAnnotation": null,
                              "loc": null,
                              "range": [
                                41,
                                42
                              ]
                            },
                            "value": {
                              "type": "Identifier",
                              "name": "a",
                              "typeAnnotation": null,
                              "loc": null,
                              "range": [
                                41,
                                42
                              ]
                            },
                            "kind": "init",
                            "method": false,
                            "shorthand": true,
                            "computed": false,
                            "loc": null,
                            "range": [
                              41,
                              42
                            ]
                          }
                        ],
                        "loc": null,
                        "range": [
                          39,
                          44
                        ]
                      },
                      "kind": "init",
                      "method": false,
                      "shorthand": false,
                      "computed": false,
                      "loc": null,
                      "range": [
                        36,
                        44
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    34,
                    46
                  ]
                },
                "loc": null,
                "range": [
                  30,
                  46
                ]
              }
            ],
            "loc": null,
            "range": [
              26,
              47
            ]
          },
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    54,
                    55
                  ]
                },
                "init": {
                  "type": "FunctionExpression",
                  "id": null,
                  "params": [],
                  "body": {
                    "type": "BlockStatement",
                    "body": [
                      {
                        "type": "ExpressionStatement",
                        "expression": {
                          "type": "CallExpression",
                          "callee": {
                            "type": "MemberExpression",
                            "object": {
                              "type": "Identifier",
                              "name": "console",
                              "typeAnnotation": null,
                              "loc": null,
                              "range": [
                                76,
                                83
                              ]
                            },
                            "property": {
                              "type": "Identifier",
                              "name": "log",
                              "typeAnnotation": null,
                              "loc": null,
                              "range": [
                                84,
                                87
                              ]
                            },
                            "computed": false,
                            "loc": null,
                            "range": [
                              76,
                              87
                            ]
                          },
                          "arguments": [
                            {
                              "type": "MemberExpression",
                              "object": {
                                "type": "MemberExpression",
                                "object": {
                                  "type": "Identifier",
                                  "name": "z",
                                  "typeAnnotation": null,
                                  "loc": null,
                                  "range": [
                                    88,
                                    89
                                  ]
                                },
                                "property": {
                                  "type": "Identifier",
                                  "name": "a",
                                  "typeAnnotation": null,
                                  "loc": null,
                                  "range": [
                                    90,
                                    91
                                  ]
                                },
                                "computed": false,
                                "loc": null,
                                "range": [
                                  88,
                                  91
                                ]
                              },
                              "property": {
                                "type": "Identifier",
                                "name": "a",
                                "typeAnnotation": null,
                                "loc": null,
                                "range": [
                                  92,
                                  93
                                ]
                              },
                              "computed": false,
                              "loc": null,
                              "range": [
                                88,
                                93
                              ]
                            }
                          ],
                          "loc": null,
                          "range": [
                            76,
                            94
                          ]
                        },
                        "directive": null,
                        "loc": null,
                        "range": [
                          76,
                          95
                        ]
                      }
                    ],
                    "loc": null,
                    "range": [
                      70,
                      99
                    ]
                  },
                  "generator": false,
                  "async": false,
                  "loc": null,
                  "range": [
                    58,
                    99
                  ],
                  "loc": null,
                  "range": [
                    58,
                    99
                  ]
                },
                "loc": null,
                "range": [
                  54,
                  99
                ]
              }
            ],
            "loc": null,
            "range": [
              50,
              100
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "Identifier",
              "name": "x",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                110,
                111
              ]
            },
            "loc": null,
            "range": [
              103,
              112
            ]
          }
        ],
        "loc": null,
        "range": [
          22,
          114
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        114
      ],
      "loc": null,
      "range": [
        0,
        114
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    114
  ]
}
