fix: ab2string() calculation of array length

This commit is contained in:
waiting
2017-10-14 16:26:26 +08:00
parent 143a1e4b13
commit 4640bed36a
+2 -2
View File
@@ -456,9 +456,9 @@ function ab2str(buf) {
return String.fromCharCode.apply(null, new Uint16Array(buf));
}
const len = bufView.byteLength;
const bstr = new Array(len);
const bufView = new Uint16Array(buf);
const len = bufView.length;
const bstr = new Array(len);
for (let i = 0; i < len; i++) {
bstr[i] = String.fromCharCode.call(null, bufView[i]);
}