---
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/useMemo-logical.js
---
Input:
function Component(props) {
  const x = useMemo(() => props.a && props.b);
  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": "const",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    36,
                    37
                  ]
                },
                "init": {
                  "type": "CallExpression",
                  "callee": {
                    "type": "Identifier",
                    "name": "useMemo",
                    "typeAnnotation": null,
                    "loc": null,
                    "range": [
                      40,
                      47
                    ]
                  },
                  "arguments": [
                    {
                      "type": "ArrowFunctionExpression",
                      "id": null,
                      "params": [],
                      "body": {
                        "type": "LogicalExpression",
                        "operator": "&&",
                        "left": {
                          "type": "MemberExpression",
                          "object": {
                            "type": "Identifier",
                            "name": "props",
                            "typeAnnotation": null,
                            "loc": null,
                            "range": [
                              54,
                              59
                            ]
                          },
                          "property": {
                            "type": "Identifier",
                            "name": "a",
                            "typeAnnotation": null,
                            "loc": null,
                            "range": [
                              60,
                              61
                            ]
                          },
                          "computed": false,
                          "loc": null,
                          "range": [
                            54,
                            61
                          ]
                        },
                        "right": {
                          "type": "MemberExpression",
                          "object": {
                            "type": "Identifier",
                            "name": "props",
                            "typeAnnotation": null,
                            "loc": null,
                            "range": [
                              65,
                              70
                            ]
                          },
                          "property": {
                            "type": "Identifier",
                            "name": "b",
                            "typeAnnotation": null,
                            "loc": null,
                            "range": [
                              71,
                              72
                            ]
                          },
                          "computed": false,
                          "loc": null,
                          "range": [
                            65,
                            72
                          ]
                        },
                        "loc": null,
                        "range": [
                          54,
                          72
                        ]
                      },
                      "generator": true,
                      "async": false,
                      "loc": null,
                      "range": [
                        48,
                        72
                      ],
                      "expression": true,
                      "loc": null,
                      "range": [
                        48,
                        72
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    40,
                    73
                  ]
                },
                "loc": null,
                "range": [
                  36,
                  73
                ]
              }
            ],
            "loc": null,
            "range": [
              30,
              74
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "Identifier",
              "name": "x",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                84,
                85
              ]
            },
            "loc": null,
            "range": [
              77,
              86
            ]
          }
        ],
        "loc": null,
        "range": [
          26,
          88
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        88
      ],
      "loc": null,
      "range": [
        0,
        88
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    88
  ]
}
