---
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/simple-scope.js
---
Input:
function foo(a) {
  const x = [a.b];
  return x;
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "foo",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          12
        ]
      },
      "params": [
        {
          "type": "Identifier",
          "name": "a",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            13,
            14
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "VariableDeclaration",
            "kind": "const",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    26,
                    27
                  ]
                },
                "init": {
                  "type": "ArrayExpression",
                  "elements": [
                    {
                      "type": "MemberExpression",
                      "object": {
                        "type": "Identifier",
                        "name": "a",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          31,
                          32
                        ]
                      },
                      "property": {
                        "type": "Identifier",
                        "name": "b",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          33,
                          34
                        ]
                      },
                      "computed": false,
                      "loc": null,
                      "range": [
                        31,
                        34
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    30,
                    35
                  ]
                },
                "loc": null,
                "range": [
                  26,
                  35
                ]
              }
            ],
            "loc": null,
            "range": [
              20,
              36
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "Identifier",
              "name": "x",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                46,
                47
              ]
            },
            "loc": null,
            "range": [
              39,
              48
            ]
          }
        ],
        "loc": null,
        "range": [
          16,
          50
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        50
      ],
      "loc": null,
      "range": [
        0,
        50
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    50
  ]
}
