diff options
author | Samuel Mannehed <samuel@cendio.se> | 2018-06-15 12:00:43 +0200 |
---|---|---|
committer | Samuel Mannehed <samuel@cendio.se> | 2018-06-15 12:00:43 +0200 |
commit | f90c2a6d4b89e8586949e2dc0fc0d530427567a0 (patch) | |
tree | f4ab3b51a373d142917e8da087af23aacb6219da | |
parent | d9814c06bfd4ecdb1192a0002e79e08c37a1e0b8 (diff) | |
download | novnc-f90c2a6d4b89e8586949e2dc0fc0d530427567a0.tar.gz |
Avoid TypedArray.slice() because of IE11
-rw-r--r-- | core/websock.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/websock.js b/core/websock.js index 8039fb8..fc77dd0 100644 --- a/core/websock.js +++ b/core/websock.js @@ -100,11 +100,10 @@ Websock.prototype = { rQshiftStr: function (len) { if (typeof(len) === 'undefined') { len = this.rQlen(); } - const arr = this.rQshiftBytes(len); let str = ""; // Handle large arrays in steps to avoid long strings on the stack 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); } return str; |