---
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-function-alias-computed-load-3.js
---
Input:
function bar(a, b) {
  let x = [a, b];
  let y = {};
  let t = {};
  (function () {
    y = x[0][1];
    t = x[1][0];
  })();

  return y;
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "bar",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          12
        ]
      },
      "params": [
        {
          "type": "Identifier",
          "name": "a",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            13,
            14
          ]
        },
        {
          "type": "Identifier",
          "name": "b",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            16,
            17
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    27,
                    28
                  ]
                },
                "init": {
                  "type": "ArrayExpression",
                  "elements": [
                    {
                      "type": "Identifier",
                      "name": "a",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        32,
                        33
                      ]
                    },
                    {
                      "type": "Identifier",
                      "name": "b",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        35,
                        36
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    31,
                    37
                  ]
                },
                "loc": null,
                "range": [
                  27,
                  37
                ]
              }
            ],
            "loc": null,
            "range": [
              23,
              38
            ]
          },
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "y",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    45,
                    46
                  ]
                },
                "init": {
                  "type": "ObjectExpression",
                  "properties": [],
                  "loc": null,
                  "range": [
                    49,
                    51
                  ]
                },
                "loc": null,
                "range": [
                  45,
                  51
                ]
              }
            ],
            "loc": null,
            "range": [
              41,
              52
            ]
          },
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "t",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    59,
                    60
                  ]
                },
                "init": {
                  "type": "ObjectExpression",
                  "properties": [],
                  "loc": null,
                  "range": [
                    63,
                    65
                  ]
                },
                "loc": null,
                "range": [
                  59,
                  65
                ]
              }
            ],
            "loc": null,
            "range": [
              55,
              66
            ]
          },
          {
            "type": "ExpressionStatement",
            "expression": {
              "type": "CallExpression",
              "callee": {
                "type": "FunctionExpression",
                "id": null,
                "params": [],
                "body": {
                  "type": "BlockStatement",
                  "body": [
                    {
                      "type": "ExpressionStatement",
                      "expression": {
                        "type": "AssignmentExpression",
                        "operator": "=",
                        "left": {
                          "type": "Identifier",
                          "name": "y",
                          "typeAnnotation": null,
                          "loc": null,
                          "range": [
                            88,
                            89
                          ]
                        },
                        "right": {
                          "type": "MemberExpression",
                          "object": {
                            "type": "MemberExpression",
                            "object": {
                              "type": "Identifier",
                              "name": "x",
                              "typeAnnotation": null,
                              "loc": null,
                              "range": [
                                92,
                                93
                              ]
                            },
                            "property": {
                              "type": "NumericLiteral",
                              "value": 0.0,
                              "loc": null,
                              "range": [
                                94,
                                95
                              ]
                            },
                            "computed": true,
                            "loc": null,
                            "range": [
                              92,
                              96
                            ]
                          },
                          "property": {
                            "type": "NumericLiteral",
                            "value": 1.0,
                            "loc": null,
                            "range": [
                              97,
                              98
                            ]
                          },
                          "computed": true,
                          "loc": null,
                          "range": [
                            92,
                            99
                          ]
                        },
                        "loc": null,
                        "range": [
                          88,
                          99
                        ]
                      },
                      "directive": null,
                      "loc": null,
                      "range": [
                        88,
                        100
                      ]
                    },
                    {
                      "type": "ExpressionStatement",
                      "expression": {
                        "type": "AssignmentExpression",
                        "operator": "=",
                        "left": {
                          "type": "Identifier",
                          "name": "t",
                          "typeAnnotation": null,
                          "loc": null,
                          "range": [
                            105,
                            106
                          ]
                        },
                        "right": {
                          "type": "MemberExpression",
                          "object": {
                            "type": "MemberExpression",
                            "object": {
                              "type": "Identifier",
                              "name": "x",
                              "typeAnnotation": null,
                              "loc": null,
                              "range": [
                                109,
                                110
                              ]
                            },
                            "property": {
                              "type": "NumericLiteral",
                              "value": 1.0,
                              "loc": null,
                              "range": [
                                111,
                                112
                              ]
                            },
                            "computed": true,
                            "loc": null,
                            "range": [
                              109,
                              113
                            ]
                          },
                          "property": {
                            "type": "NumericLiteral",
                            "value": 0.0,
                            "loc": null,
                            "range": [
                              114,
                              115
                            ]
                          },
                          "computed": true,
                          "loc": null,
                          "range": [
                            109,
                            116
                          ]
                        },
                        "loc": null,
                        "range": [
                          105,
                          116
                        ]
                      },
                      "directive": null,
                      "loc": null,
                      "range": [
                        105,
                        117
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    82,
                    121
                  ]
                },
                "generator": false,
                "async": false,
                "loc": null,
                "range": [
                  70,
                  121
                ],
                "loc": null,
                "range": [
                  70,
                  121
                ]
              },
              "arguments": [],
              "loc": null,
              "range": [
                69,
                124
              ]
            },
            "directive": null,
            "loc": null,
            "range": [
              69,
              125
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "Identifier",
              "name": "y",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                136,
                137
              ]
            },
            "loc": null,
            "range": [
              129,
              138
            ]
          }
        ],
        "loc": null,
        "range": [
          19,
          140
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        140
      ],
      "loc": null,
      "range": [
        0,
        140
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    140
  ]
}
