Re: Is BlobBuilder needed?

On Mon, Oct 24, 2011 at 4:33 PM, Eric U <ericu@google.com> wrote:
> The only things that this lacks that BlobBuilder has are the endings
> parameter for '\n' conversion in text and the content type.  The
> varargs constructor makes it awkward to pass in flags of any
> sort...any thoughts on how to do that cleanly?

Easy.  The destructuring stuff proposed for ES lets you easily say things like:

function(blobparts..., keywordargs) {
  // blobparts is an array of all but the last arg
  // keywordargs is the last arg
}

or even:

function(blobparts..., {contenttype, lineendings}) {
  // blobparts is an array of all but the last arg
  // contenttype and lineendings are pulled from the
  // last arg, if it's an object with those properties
}

~TJ

Received on Monday, 24 October 2011 23:47:18 UTC