From f90c2a6d4b89e8586949e2dc0fc0d530427567a0 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Fri, 15 Jun 2018 12:00:43 +0200 Subject: Avoid TypedArray.slice() because of IE11 --- core/websock.js | 3 +-- 1 file changed, 1 insertion(+), 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; -- cgit v1.2.1