There was an error while loading. Please reload this page.
1 parent 42e5a9c commit d4e46dfCopy full SHA for d4e46df
src/reader.js
@@ -313,7 +313,9 @@ Reader.prototype.bytes = function read_bytes() {
313
if (Array.isArray(this.buf)) // plain array
314
return this.buf.slice(start, end);
315
return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1
316
- ? new this.buf.constructor(0)
+ ? (typeof Buffer.alloc === "function")
317
+ ? Buffer.alloc(0)
318
+ : new this.buf.constructor(0)
319
: this._slice.call(this.buf, start, end);
320
};
321
0 commit comments