---
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/delete-property.js
---
Input:
function Component(props) {
  const x = { a: props.a, b: props.b };
  delete x.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": "ObjectExpression",
                  "properties": [
                    {
                      "type": "Property",
                      "key": {
                        "type": "Identifier",
                        "name": "a",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          42,
                          43
                        ]
                      },
                      "value": {
                        "type": "MemberExpression",
                        "object": {
                          "type": "Identifier",
                          "name": "props",
                          "typeAnnotation": null,
                          "loc": null,
                          "range": [
                            45,
                            50
                          ]
                        },
                        "property": {
                          "type": "Identifier",
                          "name": "a",
                          "typeAnnotation": null,
                          "loc": null,
                          "range": [
                            51,
                            52
                          ]
                        },
                        "computed": false,
                        "loc": null,
                        "range": [
                          45,
                          52
                        ]
                      },
                      "kind": "init",
                      "method": false,
                      "shorthand": false,
                      "computed": false,
                      "loc": null,
                      "range": [
                        42,
                        52
                      ]
                    },
                    {
                      "type": "Property",
                      "key": {
                        "type": "Identifier",
                        "name": "b",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          54,
                          55
                        ]
                      },
                      "value": {
                        "type": "MemberExpression",
                        "object": {
                          "type": "Identifier",
                          "name": "props",
                          "typeAnnotation": null,
                          "loc": null,
                          "range": [
                            57,
                            62
                          ]
                        },
                        "property": {
                          "type": "Identifier",
                          "name": "b",
                          "typeAnnotation": null,
                          "loc": null,
                          "range": [
                            63,
                            64
                          ]
                        },
                        "computed": false,
                        "loc": null,
                        "range": [
                          57,
                          64
                        ]
                      },
                      "kind": "init",
                      "method": false,
                      "shorthand": false,
                      "computed": false,
                      "loc": null,
                      "range": [
                        54,
                        64
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    40,
                    66
                  ]
                },
                "loc": null,
                "range": [
                  36,
                  66
                ]
              }
            ],
            "loc": null,
            "range": [
              30,
              67
            ]
          },
          {
            "type": "ExpressionStatement",
            "expression": {
              "type": "UnaryExpression",
              "operator": "delete",
              "prefix": true,
              "argument": {
                "type": "MemberExpression",
                "object": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    77,
                    78
                  ]
                },
                "property": {
                  "type": "Identifier",
                  "name": "b",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    79,
                    80
                  ]
                },
                "computed": false,
                "loc": null,
                "range": [
                  77,
                  80
                ]
              },
              "loc": null,
              "range": [
                70,
                80
              ]
            },
            "directive": null,
            "loc": null,
            "range": [
              70,
              81
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "Identifier",
              "name": "x",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                91,
                92
              ]
            },
            "loc": null,
            "range": [
              84,
              93
            ]
          }
        ],
        "loc": null,
        "range": [
          26,
          95
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        95
      ],
      "loc": null,
      "range": [
        0,
        95
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    95
  ]
}
