Avoid TypedArray.slice() because of IE11
This commit is contained in:
parent
d9814c06bf
commit
f90c2a6d4b
|
@ -100,11 +100,10 @@ Websock.prototype = {
|
||||||
|
|
||||||
rQshiftStr: function (len) {
|
rQshiftStr: function (len) {
|
||||||
if (typeof(len) === 'undefined') { len = this.rQlen(); }
|
if (typeof(len) === 'undefined') { len = this.rQlen(); }
|
||||||
const arr = this.rQshiftBytes(len);
|
|
||||||
let str = "";
|
let str = "";
|
||||||
// Handle large arrays in steps to avoid long strings on the stack
|
// Handle large arrays in steps to avoid long strings on the stack
|
||||||
for (let i = 0; i < len; i += 4096) {
|
for (let i = 0; i < len; i += 4096) {
|
||||||
let part = arr.slice(i, Math.min(i + 4096, len));
|
let part = this.rQshiftBytes(Math.min(4096, len - i));
|
||||||
str += String.fromCharCode.apply(null, part);
|
str += String.fromCharCode.apply(null, part);
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
|
|
Loading…
Reference in New Issue