---
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/object-pattern-params.js
---
Input:
function component({ a, b }) {
  let y = { a };
  let z = { b };
  return { y, z };
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "component",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          18
        ]
      },
      "params": [
        {
          "type": "ObjectPattern",
          "properties": [
            {
              "type": "Property",
              "key": {
                "type": "Identifier",
                "name": "a",
                "typeAnnotation": null,
                "loc": null,
                "range": [
                  21,
                  22
                ]
              },
              "value": {
                "type": "Identifier",
                "name": "a",
                "typeAnnotation": null,
                "loc": null,
                "range": [
                  21,
                  22
                ]
              },
              "kind": "init",
              "computed": false,
              "shorthand": true,
              "method": false,
              "loc": null,
              "range": [
                21,
                22
              ]
            },
            {
              "type": "Property",
              "key": {
                "type": "Identifier",
                "name": "b",
                "typeAnnotation": null,
                "loc": null,
                "range": [
                  24,
                  25
                ]
              },
              "value": {
                "type": "Identifier",
                "name": "b",
                "typeAnnotation": null,
                "loc": null,
                "range": [
                  24,
                  25
                ]
              },
              "kind": "init",
              "computed": false,
              "shorthand": true,
              "method": false,
              "loc": null,
              "range": [
                24,
                25
              ]
            }
          ],
          "loc": null,
          "range": [
            19,
            27
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "y",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    37,
                    38
                  ]
                },
                "init": {
                  "type": "ObjectExpression",
                  "properties": [
                    {
                      "type": "Property",
                      "key": {
                        "type": "Identifier",
                        "name": "a",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          43,
                          44
                        ]
                      },
                      "value": {
                        "type": "Identifier",
                        "name": "a",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          43,
                          44
                        ]
                      },
                      "kind": "init",
                      "method": false,
                      "shorthand": true,
                      "computed": false,
                      "loc": null,
                      "range": [
                        43,
                        44
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    41,
                    46
                  ]
                },
                "loc": null,
                "range": [
                  37,
                  46
                ]
              }
            ],
            "loc": null,
            "range": [
              33,
              47
            ]
          },
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "z",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    54,
                    55
                  ]
                },
                "init": {
                  "type": "ObjectExpression",
                  "properties": [
                    {
                      "type": "Property",
                      "key": {
                        "type": "Identifier",
                        "name": "b",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          60,
                          61
                        ]
                      },
                      "value": {
                        "type": "Identifier",
                        "name": "b",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          60,
                          61
                        ]
                      },
                      "kind": "init",
                      "method": false,
                      "shorthand": true,
                      "computed": false,
                      "loc": null,
                      "range": [
                        60,
                        61
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    58,
                    63
                  ]
                },
                "loc": null,
                "range": [
                  54,
                  63
                ]
              }
            ],
            "loc": null,
            "range": [
              50,
              64
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "ObjectExpression",
              "properties": [
                {
                  "type": "Property",
                  "key": {
                    "type": "Identifier",
                    "name": "y",
                    "typeAnnotation": null,
                    "loc": null,
                    "range": [
                      76,
                      77
                    ]
                  },
                  "value": {
                    "type": "Identifier",
                    "name": "y",
                    "typeAnnotation": null,
                    "loc": null,
                    "range": [
                      76,
                      77
                    ]
                  },
                  "kind": "init",
                  "method": false,
                  "shorthand": true,
                  "computed": false,
                  "loc": null,
                  "range": [
                    76,
                    77
                  ]
                },
                {
                  "type": "Property",
                  "key": {
                    "type": "Identifier",
                    "name": "z",
                    "typeAnnotation": null,
                    "loc": null,
                    "range": [
                      79,
                      80
                    ]
                  },
                  "value": {
                    "type": "Identifier",
                    "name": "z",
                    "typeAnnotation": null,
                    "loc": null,
                    "range": [
                      79,
                      80
                    ]
                  },
                  "kind": "init",
                  "method": false,
                  "shorthand": true,
                  "computed": false,
                  "loc": null,
                  "range": [
                    79,
                    80
                  ]
                }
              ],
              "loc": null,
              "range": [
                74,
                82
              ]
            },
            "loc": null,
            "range": [
              67,
              83
            ]
          }
        ],
        "loc": null,
        "range": [
          29,
          85
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        85
      ],
      "loc": null,
      "range": [
        0,
        85
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    85
  ]
}
