---
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/escape-analysis-not-conditional-test.js
---
Input:
function Component(props) {
  const x = [props.a];
  const y = x ? props.b : props.c;
  return y;
}


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": "ArrayExpression",
                  "elements": [
                    {
                      "type": "MemberExpression",
                      "object": {
                        "type": "Identifier",
                        "name": "props",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          41,
                          46
                        ]
                      },
                      "property": {
                        "type": "Identifier",
                        "name": "a",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          47,
                          48
                        ]
                      },
                      "computed": false,
                      "loc": null,
                      "range": [
                        41,
                        48
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    40,
                    49
                  ]
                },
                "loc": null,
                "range": [
                  36,
                  49
                ]
              }
            ],
            "loc": null,
            "range": [
              30,
              50
            ]
          },
          {
            "type": "VariableDeclaration",
            "kind": "const",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "y",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    59,
                    60
                  ]
                },
                "init": {
                  "type": "ConditionalExpression",
                  "test": {
                    "type": "Identifier",
                    "name": "x",
                    "typeAnnotation": null,
                    "loc": null,
                    "range": [
                      63,
                      64
                    ]
                  },
                  "alternate": {
                    "type": "MemberExpression",
                    "object": {
                      "type": "Identifier",
                      "name": "props",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        77,
                        82
                      ]
                    },
                    "property": {
                      "type": "Identifier",
                      "name": "c",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        83,
                        84
                      ]
                    },
                    "computed": false,
                    "loc": null,
                    "range": [
                      77,
                      84
                    ]
                  },
                  "consequent": {
                    "type": "MemberExpression",
                    "object": {
                      "type": "Identifier",
                      "name": "props",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        67,
                        72
                      ]
                    },
                    "property": {
                      "type": "Identifier",
                      "name": "b",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        73,
                        74
                      ]
                    },
                    "computed": false,
                    "loc": null,
                    "range": [
                      67,
                      74
                    ]
                  },
                  "loc": null,
                  "range": [
                    63,
                    84
                  ]
                },
                "loc": null,
                "range": [
                  59,
                  84
                ]
              }
            ],
            "loc": null,
            "range": [
              53,
              85
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "Identifier",
              "name": "y",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                95,
                96
              ]
            },
            "loc": null,
            "range": [
              88,
              97
            ]
          }
        ],
        "loc": null,
        "range": [
          26,
          99
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        99
      ],
      "loc": null,
      "range": [
        0,
        99
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    99
  ]
}
