============================================
Object destructuring assignments
============================================

{a, b} = object
let {a, b, ...c} = object
const {a, b: {c, d}} = object

---

(program
  (expression_statement (assignment_expression
    (object_pattern
      (shorthand_property_identifier)
      (shorthand_property_identifier))
    (identifier)))
  (lexical_declaration (variable_declarator
    (object_pattern
      (shorthand_property_identifier)
      (shorthand_property_identifier)
      (spread_element (identifier)))
    (identifier)))
  (lexical_declaration (variable_declarator
    (object_pattern
      (shorthand_property_identifier)
      (pair
        (property_identifier)
        (object
          (shorthand_property_identifier)
          (shorthand_property_identifier))))
    (identifier))))

============================================
Object destructuring parameters
============================================

function a ({b, c}, {d}) {}

---

(program
  (function (identifier)
    (formal_parameters
      (object_pattern (shorthand_property_identifier) (shorthand_property_identifier))
      (object_pattern (shorthand_property_identifier)))
    (statement_block)))

============================================
Array destructuring assignments
============================================

[a, b] = array;
[a, b, ...c] = array;
[,, c,, d,] = array;

---

(program
  (expression_statement (assignment_expression
    (array_pattern
      (identifier)
      (identifier))
    (identifier)))
  (expression_statement (assignment_expression
    (array_pattern
      (identifier)
      (identifier)
      (spread_element (identifier)))
    (identifier)))
  (expression_statement (assignment_expression
    (array_pattern
      (identifier)
      (identifier))
    (identifier))))

================================================
Object destructuring patterns w/ default values
================================================

function a({b = true}, [c, d = false]) {}
function b({c} = {}) {}

---

(program
  (function (identifier)
    (formal_parameters
      (object_pattern (assignment_pattern (shorthand_property_identifier) (true)))
      (array_pattern (identifier) (assignment_expression (identifier) (false))))
    (statement_block))
  (function (identifier)
    (formal_parameters
      (assignment_pattern (object_pattern (shorthand_property_identifier)) (object)))
    (statement_block)))
