---
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/error.call-args-destructuring-asignment-complex.js
---
Input:
function Component(props) {
  let x = makeObject();
  x.foo(([[x]] = makeObject()));
  return x;
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "Component",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          18
        ]
      },
      "params": [
        {
          "type": "Identifier",
          "name": "props",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            19,
            24
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    34,
                    35
                  ]
                },
                "init": {
                  "type": "CallExpression",
                  "callee": {
                    "type": "Identifier",
                    "name": "makeObject",
                    "typeAnnotation": null,
                    "loc": null,
                    "range": [
                      38,
                      48
                    ]
                  },
                  "arguments": [],
                  "loc": null,
                  "range": [
                    38,
                    50
                  ]
                },
                "loc": null,
                "range": [
                  34,
                  50
                ]
              }
            ],
            "loc": null,
            "range": [
              30,
              51
            ]
          },
          {
            "type": "ExpressionStatement",
            "expression": {
              "type": "CallExpression",
              "callee": {
                "type": "MemberExpression",
                "object": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    54,
                    55
                  ]
                },
                "property": {
                  "type": "Identifier",
                  "name": "foo",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    56,
                    59
                  ]
                },
                "computed": false,
                "loc": null,
                "range": [
                  54,
                  59
                ]
              },
              "arguments": [
                {
                  "type": "AssignmentExpression",
                  "operator": "=",
                  "left": {
                    "type": "ArrayPattern",
                    "elements": [
                      {
                        "type": "ArrayPattern",
                        "elements": [
                          {
                            "type": "Identifier",
                            "name": "x",
                            "typeAnnotation": null,
                            "loc": null,
                            "range": [
                              63,
                              64
                            ]
                          }
                        ],
                        "loc": null,
                        "range": [
                          62,
                          65
                        ]
                      }
                    ],
                    "loc": null,
                    "range": [
                      61,
                      66
                    ]
                  },
                  "right": {
                    "type": "CallExpression",
                    "callee": {
                      "type": "Identifier",
                      "name": "makeObject",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        69,
                        79
                      ]
                    },
                    "arguments": [],
                    "loc": null,
                    "range": [
                      69,
                      81
                    ]
                  },
                  "loc": null,
                  "range": [
                    61,
                    81
                  ]
                }
              ],
              "loc": null,
              "range": [
                54,
                83
              ]
            },
            "directive": null,
            "loc": null,
            "range": [
              54,
              84
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "Identifier",
              "name": "x",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                94,
                95
              ]
            },
            "loc": null,
            "range": [
              87,
              96
            ]
          }
        ],
        "loc": null,
        "range": [
          26,
          98
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        98
      ],
      "loc": null,
      "range": [
        0,
        98
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    98
  ]
}
