We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaf9f0a commit a1bd21fCopy full SHA for a1bd21f
src/reader.js
@@ -312,8 +312,11 @@ Reader.prototype.bytes = function read_bytes() {
312
this.pos += length;
313
if (Array.isArray(this.buf)) // plain array
314
return this.buf.slice(start, end);
315
+ var nativeBuffer = util.Buffer;
316
return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1
- ? new this.buf.constructor(0)
317
+ ? (nativeBuffer)
318
+ ? nativeBuffer.alloc(0)
319
+ : new this.buf.constructor(0)
320
: this._slice.call(this.buf, start, end);
321
};
322
0 commit comments