(#2497) - fix attachments in Chrome and IE

Yes, this is really what we have to do to get it to pass in IE. I'm sorry.
We want setTimeout then, process.nexttick won't prevent freezing
On Jul 19, 2014 9:28 PM, "Nolan Lawson" <notifications@github.com> wrote:

> In lib/deps/md5.js:
>
> > +    return;
> > +  }
> > +  var chunkSize = Math.min(524288, data.length);
> > +  var chunks = Math.ceil(data.length / chunkSize);
> > +  var currentChunk = 0;
> > +  var buffer = new Md5();
> > +  function loadNextChunk() {
> > +    var start = currentChunk * chunkSize;
> > +    var end = start + chunkSize;
> > +    if ((start + chunkSize) >= data.size) {
> > +      end = data.size;
> > +    }
> > +    currentChunk++;
> > +    if (currentChunk < chunks) {
> > +      buffer.append(sliceShim(data, start, end));
> > +      process.nextTick(loadNextChunk);
>
> changed setImmediate to process.nextTick. setImmediate is great, but it's
> not implemented in every browser
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pouchdb/pouchdb/pull/2498/files#r15147040>.
>