Return array buffer when possible

This commit is contained in:
Jimmy Wärting
2019-04-19 17:26:24 +02:00
parent eb14683b06
commit 107ede1789
+3 -2
View File
@@ -465,8 +465,9 @@
}
FileReader.prototype.readAsArrayBuffer = function (blob) {
_read(this, blob, 'readAsText')
this.result = blob._buffer.slice()
_read(this, blob, 'readAsText')
// return ArrayBuffer when possible
this.result = (blob._buffer.buffer || blob._buffer).slice()
}
FileReader.prototype.abort = function () {}