code: private void collapseAssign(Node assign, Node expr, Node exprParent) {
      Node leftValue = assign.getFirstChild();
      Node rightValue = leftValue.getNext();
  
      if (leftValue.isDestructuringPattern()) {
        // We don't collapse expressions containing these because they can have side effects:
        //   - Reassigning RHS names. (e.g. `() => { ({c: a} = a); return a; }`).
        //   - Calling a getter defined on the RHS.
        //   - Evaluating a default value.
        // TODO(b/123102446): Check for these issues and optimize when they aren't present.
        return;
      } else if (isCollapsibleValue(leftValue, true)
          && collapseAssignEqualTo(expr, exprParent, leftValue)) {
        // Condition has side-effects.
      } else if (isCollapsibleValue(rightValue, false)
          && collapseAssignEqualTo(expr, exprParent, rightValue)) {
        // Condition has side-effects.
      } else if (rightValue.isAssign()) {
        // Recursively deal with nested assigns.
        collapseAssign(rightValue, expr, exprParent);
      }
    }
docs: Try to collapse the given assign into subsequent expressions.