code: private static void replaceDestructuringAssignment(Node pattern, Node newLvalue, Node newRvalue) {
      Node parent = pattern.getParent();
      if (parent.isAssign()) {
        Node newAssign = IR.assign(newLvalue, newRvalue).srcref(parent);
        parent.replaceWith(newAssign);
      } else if (newLvalue.isName()) {
        checkState(parent.isDestructuringLhs());
        parent.replaceWith(newLvalue);
        newLvalue.addChildToBack(newRvalue);
      } else {
        pattern.getNext().detach();
        pattern.detach();
        parent.addChildToBack(newLvalue);
        parent.addChildToBack(newRvalue);
      }
    }
docs: Replaces the given assignment or declaration with the new lvalue/rvalue
  
  @param pattern a destructuring pattern in an ASSIGN or VAR/LET/CONST