summaryrefslogtreecommitdiff
path: root/core/websock.js
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2018-06-15 12:00:43 +0200
committerSamuel Mannehed <samuel@cendio.se>2018-06-15 12:00:43 +0200
commitf90c2a6d4b89e8586949e2dc0fc0d530427567a0 (patch)
treef4ab3b51a373d142917e8da087af23aacb6219da /core/websock.js
parentd9814c06bfd4ecdb1192a0002e79e08c37a1e0b8 (diff)
downloadnovnc-f90c2a6d4b89e8586949e2dc0fc0d530427567a0.tar.gz
Avoid TypedArray.slice() because of IE11
Diffstat (limited to 'core/websock.js')
-rw-r--r--core/websock.js3
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;