From ed34b093839652db2ff7b84db87857fc57d96038 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Tue, 11 Apr 2017 14:56:07 +0200 Subject: [PATCH] Fixed: Reader#bytes should also support plain arrays --- src/reader.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/reader.js b/src/reader.js index 679d0d237..b339af4aa 100644 --- a/src/reader.js +++ b/src/reader.js @@ -306,6 +306,8 @@ Reader.prototype.bytes = function read_bytes() { throw indexOutOfRange(this, length); this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 ? new this.buf.constructor(0) : this._slice.call(this.buf, start, end);