Skip to content

Commit aab49de

Browse files
abcd-cashellscape
authored andcommitted
iOS Safari 10 bug where SockJS couldn't be found (#1238)
* iOS Safari 10 bug where SockJS couldn't be found Fixes iOS Safari 10 bug. At the root, this works around a bug where Safari's eval's scope was getting confused. Something to do with [this issue](https://stackoverflow.com/questions/46036960/evaluated-expression-const-variable-scope-in-safari) [bug reference](#1090 (comment)) * named function to satisfy linter
1 parent a168b81 commit aab49de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/socket.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const SockJS = require('sockjs-client/dist/sockjs');
55
let retries = 0;
66
let sock = null;
77

8-
function socket(url, handlers) {
8+
const socket = function initSocket(url, handlers) {
99
sock = new SockJS(url);
1010

1111
sock.onopen = function onopen() {
@@ -37,6 +37,6 @@ function socket(url, handlers) {
3737
const msg = JSON.parse(e.data);
3838
if (handlers[msg.type]) { handlers[msg.type](msg.data); }
3939
};
40-
}
40+
};
4141

4242
module.exports = socket;

0 commit comments

Comments
 (0)