---
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/lambda-mutated-non-reactive-to-reactive.js
---
Input:
function f(a) {
  let x;
  (() => {
    x = { a };
  })();
  return <div x={x} />;
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "f",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          10
        ]
      },
      "params": [
        {
          "type": "Identifier",
          "name": "a",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            11,
            12
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    22,
                    23
                  ]
                },
                "init": null,
                "loc": null,
                "range": [
                  22,
                  23
                ]
              }
            ],
            "loc": null,
            "range": [
              18,
              24
            ]
          },
          {
            "type": "ExpressionStatement",
            "expression": {
              "type": "CallExpression",
              "callee": {
                "type": "ArrowFunctionExpression",
                "id": null,
                "params": [],
                "body": {
                  "type": "BlockStatement",
                  "body": [
                    {
                      "type": "ExpressionStatement",
                      "expression": {
                        "type": "AssignmentExpression",
                        "operator": "=",
                        "left": {
                          "type": "Identifier",
                          "name": "x",
                          "typeAnnotation": null,
                          "loc": null,
                          "range": [
                            40,
                            41
                          ]
                        },
                        "right": {
                          "type": "ObjectExpression",
                          "properties": [
                            {
                              "type": "Property",
                              "key": {
                                "type": "Identifier",
                                "name": "a",
                                "typeAnnotation": null,
                                "loc": null,
                                "range": [
                                  46,
                                  47
                                ]
                              },
                              "value": {
                                "type": "Identifier",
                                "name": "a",
                                "typeAnnotation": null,
                                "loc": null,
                                "range": [
                                  46,
                                  47
                                ]
                              },
                              "kind": "init",
                              "method": false,
                              "shorthand": true,
                              "computed": false,
                              "loc": null,
                              "range": [
                                46,
                                47
                              ]
                            }
                          ],
                          "loc": null,
                          "range": [
                            44,
                            49
                          ]
                        },
                        "loc": null,
                        "range": [
                          40,
                          49
                        ]
                      },
                      "directive": null,
                      "loc": null,
                      "range": [
                        40,
                        50
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    34,
                    54
                  ]
                },
                "generator": false,
                "async": false,
                "loc": null,
                "range": [
                  28,
                  54
                ],
                "expression": false,
                "loc": null,
                "range": [
                  28,
                  54
                ]
              },
              "arguments": [],
              "loc": null,
              "range": [
                27,
                57
              ]
            },
            "directive": null,
            "loc": null,
            "range": [
              27,
              58
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "JSXElement",
              "openingElement": {
                "type": "JSXOpeningElement",
                "name": {
                  "type": "JSXIdentifier",
                  "name": "div",
                  "loc": null,
                  "range": [
                    69,
                    72
                  ]
                },
                "attributes": [
                  {
                    "type": "JSXAttribute",
                    "name": {
                      "type": "JSXIdentifier",
                      "name": "x",
                      "loc": null,
                      "range": [
                        73,
                        74
                      ]
                    },
                    "value": {
                      "type": "JSXExpressionContainer",
                      "expression": {
                        "type": "Identifier",
                        "name": "x",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          76,
                          77
                        ]
                      },
                      "loc": null,
                      "range": [
                        75,
                        78
                      ]
                    },
                    "loc": null,
                    "range": [
                      73,
                      78
                    ]
                  }
                ],
                "selfClosing": true,
                "loc": null,
                "range": [
                  68,
                  81
                ]
              },
              "children": [],
              "closingElement": null,
              "loc": null,
              "range": [
                68,
                81
              ]
            },
            "loc": null,
            "range": [
              61,
              82
            ]
          }
        ],
        "loc": null,
        "range": [
          14,
          84
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        84
      ],
      "loc": null,
      "range": [
        0,
        84
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    84
  ]
}
