Skip to content

Commit

Permalink
[fix] fix NodeWebSocket declaration (#613)
Browse files Browse the repository at this point in the history
NodeWebSocket was be required ONLY if global variables self and WebSocket were not defined.

Closes #609
  • Loading branch information
szymonlesisz authored and darrachequesne committed Sep 13, 2019
1 parent 242ea9e commit 0eeaa7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/transports/websocket.js
Expand Up @@ -15,7 +15,9 @@ if (typeof WebSocket !== 'undefined') {
BrowserWebSocket = WebSocket;
} else if (typeof self !== 'undefined') {
BrowserWebSocket = self.WebSocket || self.MozWebSocket;
} else {
}

if (typeof window === 'undefined') {
try {
NodeWebSocket = require('ws');
} catch (e) { }
Expand Down

0 comments on commit 0eeaa7a

Please sign in to comment.