createArrayFromElements_(elements) {
    let length = elements.length;

    // Coalesce multiple non spread elements.
    let args = [];
    let lastArray;
    for (let i = 0; i < length; i++) {
      // Arrays can contain holes which are represented by null.
      if (elements[i] && elements[i].type === SPREAD_EXPRESSION) {
        if (lastArray) {
          args.push(createArrayLiteral(lastArray));
          lastArray = null;
        }
        args.push(
            this.transformAny(elements[i].expression));
      } else {
        if (!lastArray)
          lastArray = [];
        lastArray.push(this.transformAny(elements[i]));
      }
    }
    if (lastArray)
      args.push(createArrayLiteral(lastArray));

    const spread = this.getRuntimeExpression('spread');
    return parseExpression `${spread}(${createArgumentList(args)})`;
  }
Creates an expression that results in an array where all the elements are
spread.

  ...xs, x, ...ys, y, z

transforms to something like

  _spread(xs, [x], ys, [y, z])

@param {Array.<ParseTree>} elements
@return {CallExpression}
@private