---
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/ssa-call-jsx.js
---
Input:
function foo() {}

function Component(props) {
  const a = [];
  const b = {};
  foo(a, b);
  let _ = <div a={a} />;
  foo(a, b);
  return <div a={a} b={b} />;
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "foo",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          12
        ]
      },
      "params": [],
      "body": {
        "type": "BlockStatement",
        "body": [],
        "loc": null,
        "range": [
          15,
          17
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        17
      ],
      "loc": null,
      "range": [
        0,
        17
      ]
    },
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "Component",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          28,
          37
        ]
      },
      "params": [
        {
          "type": "Identifier",
          "name": "props",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            38,
            43
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "VariableDeclaration",
            "kind": "const",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "a",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    55,
                    56
                  ]
                },
                "init": {
                  "type": "ArrayExpression",
                  "elements": [],
                  "loc": null,
                  "range": [
                    59,
                    61
                  ]
                },
                "loc": null,
                "range": [
                  55,
                  61
                ]
              }
            ],
            "loc": null,
            "range": [
              49,
              62
            ]
          },
          {
            "type": "VariableDeclaration",
            "kind": "const",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "b",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    71,
                    72
                  ]
                },
                "init": {
                  "type": "ObjectExpression",
                  "properties": [],
                  "loc": null,
                  "range": [
                    75,
                    77
                  ]
                },
                "loc": null,
                "range": [
                  71,
                  77
                ]
              }
            ],
            "loc": null,
            "range": [
              65,
              78
            ]
          },
          {
            "type": "ExpressionStatement",
            "expression": {
              "type": "CallExpression",
              "callee": {
                "type": "Identifier",
                "name": "foo",
                "typeAnnotation": null,
                "loc": null,
                "range": [
                  81,
                  84
                ]
              },
              "arguments": [
                {
                  "type": "Identifier",
                  "name": "a",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    85,
                    86
                  ]
                },
                {
                  "type": "Identifier",
                  "name": "b",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    88,
                    89
                  ]
                }
              ],
              "loc": null,
              "range": [
                81,
                90
              ]
            },
            "directive": null,
            "loc": null,
            "range": [
              81,
              91
            ]
          },
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "_",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    98,
                    99
                  ]
                },
                "init": {
                  "type": "JSXElement",
                  "openingElement": {
                    "type": "JSXOpeningElement",
                    "name": {
                      "type": "JSXIdentifier",
                      "name": "div",
                      "loc": null,
                      "range": [
                        103,
                        106
                      ]
                    },
                    "attributes": [
                      {
                        "type": "JSXAttribute",
                        "name": {
                          "type": "JSXIdentifier",
                          "name": "a",
                          "loc": null,
                          "range": [
                            107,
                            108
                          ]
                        },
                        "value": {
                          "type": "JSXExpressionContainer",
                          "expression": {
                            "type": "Identifier",
                            "name": "a",
                            "typeAnnotation": null,
                            "loc": null,
                            "range": [
                              110,
                              111
                            ]
                          },
                          "loc": null,
                          "range": [
                            109,
                            112
                          ]
                        },
                        "loc": null,
                        "range": [
                          107,
                          112
                        ]
                      }
                    ],
                    "selfClosing": true,
                    "loc": null,
                    "range": [
                      102,
                      115
                    ]
                  },
                  "children": [],
                  "closingElement": null,
                  "loc": null,
                  "range": [
                    102,
                    115
                  ]
                },
                "loc": null,
                "range": [
                  98,
                  115
                ]
              }
            ],
            "loc": null,
            "range": [
              94,
              116
            ]
          },
          {
            "type": "ExpressionStatement",
            "expression": {
              "type": "CallExpression",
              "callee": {
                "type": "Identifier",
                "name": "foo",
                "typeAnnotation": null,
                "loc": null,
                "range": [
                  119,
                  122
                ]
              },
              "arguments": [
                {
                  "type": "Identifier",
                  "name": "a",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    123,
                    124
                  ]
                },
                {
                  "type": "Identifier",
                  "name": "b",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    126,
                    127
                  ]
                }
              ],
              "loc": null,
              "range": [
                119,
                128
              ]
            },
            "directive": null,
            "loc": null,
            "range": [
              119,
              129
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "JSXElement",
              "openingElement": {
                "type": "JSXOpeningElement",
                "name": {
                  "type": "JSXIdentifier",
                  "name": "div",
                  "loc": null,
                  "range": [
                    140,
                    143
                  ]
                },
                "attributes": [
                  {
                    "type": "JSXAttribute",
                    "name": {
                      "type": "JSXIdentifier",
                      "name": "a",
                      "loc": null,
                      "range": [
                        144,
                        145
                      ]
                    },
                    "value": {
                      "type": "JSXExpressionContainer",
                      "expression": {
                        "type": "Identifier",
                        "name": "a",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          147,
                          148
                        ]
                      },
                      "loc": null,
                      "range": [
                        146,
                        149
                      ]
                    },
                    "loc": null,
                    "range": [
                      144,
                      149
                    ]
                  },
                  {
                    "type": "JSXAttribute",
                    "name": {
                      "type": "JSXIdentifier",
                      "name": "b",
                      "loc": null,
                      "range": [
                        150,
                        151
                      ]
                    },
                    "value": {
                      "type": "JSXExpressionContainer",
                      "expression": {
                        "type": "Identifier",
                        "name": "b",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          153,
                          154
                        ]
                      },
                      "loc": null,
                      "range": [
                        152,
                        155
                      ]
                    },
                    "loc": null,
                    "range": [
                      150,
                      155
                    ]
                  }
                ],
                "selfClosing": true,
                "loc": null,
                "range": [
                  139,
                  158
                ]
              },
              "children": [],
              "closingElement": null,
              "loc": null,
              "range": [
                139,
                158
              ]
            },
            "loc": null,
            "range": [
              132,
              159
            ]
          }
        ],
        "loc": null,
        "range": [
          45,
          161
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        19,
        161
      ],
      "loc": null,
      "range": [
        19,
        161
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    161
  ]
}
