desugarPattern_(desugaring, tree) {
    let initializerFound = false;
    let pattern;
    switch (tree.type) {
      case ARRAY_PATTERN: {
        pattern = tree;
        this.pushTempScope();
        let iterId = createIdentifierExpression(this.addTempVar());
        let iterObjectId = createIdentifierExpression(this.addTempVar());
        desugaring.createIterator(iterId);

        for (let i = 0; i < pattern.elements.length; i++) {
          let lvalue = pattern.elements[i];
          if (lvalue === null) {
            // A skip, for example [a,,c]
            desugaring.skipHole(iterId);
            continue;
          } else if (lvalue.isSpreadPatternElement()) {
            // Rest of the array, for example [x, ...y] = [1, 2, 3]
            let iteratorToArray = this.getRuntimeExpression('iteratorToArray');
            desugaring.assign(
                lvalue.lvalue,
                parseExpression `${iteratorToArray}(${iterId})`);
          } else {
            if (lvalue.initializer) {
              initializerFound = true;
            }
            desugaring.assign(
                lvalue,
                this.createConditionalIterExpression(iterObjectId, iterId,
                                                     lvalue.initializer));
          }
        }
        this.popTempScope();
        break;
      }

      case OBJECT_PATTERN: {
        pattern = tree;

        let elementHelper = (lvalue, initializer) => {
          if (initializer)
            initializerFound = true;
          let lookup = this.createConditionalMemberExpression(desugaring.rvalue,
              lvalue, initializer);
          desugaring.assign(lvalue, lookup);
        };

        pattern.fields.forEach((field) => {
          let lookup;
          switch (field.type) {
            case ASSIGNMENT_ELEMENT:
              elementHelper(field.assignment, field.initializer);
              break;

            case BINDING_ELEMENT:
              elementHelper(field.binding, field.initializer);
              break;

            case OBJECT_PATTERN_FIELD: {
              if (field.element.initializer)
                initializerFound = true;
              let name = field.name;
              lookup = this.createConditionalMemberExpression(desugaring.rvalue,
                  name, field.element.initializer);
              desugaring.assign(field.element, lookup);
              break;
            }

            default:
              throw Error('unreachable');
          }
        });
        break;
      }

      case PAREN_EXPRESSION:
        return this.desugarPattern_(desugaring, tree.expression);

      default:
        throw new Error('unreachable');
    }

    // In case we have `var {} = expr` or `var [] = expr` we use a temp
    // variable name so that the expression still gets executed.
    //
    // AssignmentExpressionDesugaring already works.
    if (desugaring instanceof VariableDeclarationDesugaring &&
        desugaring.declarations.length === 0) {
      desugaring.assign(createBindingIdentifier(this.getTempIdentifier()),
                        desugaring.rvalue);
    }

    return initializerFound;
  }
@param {Desugaring} desugaring
@param {ParseTree} tree
@return {boolean} True if any of the patterns have an initializer.