@@ -4297,13 +4297,17 @@ return /******/ (function(modules) { // webpackBootstrap
4297
4297
var inherit = __webpack_require__ ( 19 ) ;
4298
4298
var yeast = __webpack_require__ ( 20 ) ;
4299
4299
var debug = __webpack_require__ ( 21 ) ( 'engine.io-client:websocket' ) ;
4300
+
4300
4301
var BrowserWebSocket , NodeWebSocket ;
4301
- if ( typeof self === 'undefined' ) {
4302
+
4303
+ if ( typeof WebSocket !== 'undefined' ) {
4304
+ BrowserWebSocket = WebSocket ;
4305
+ } else if ( typeof self !== 'undefined' ) {
4306
+ BrowserWebSocket = self . WebSocket || self . MozWebSocket ;
4307
+ } else {
4302
4308
try {
4303
4309
NodeWebSocket = __webpack_require__ ( 27 ) ;
4304
4310
} catch ( e ) { }
4305
- } else {
4306
- BrowserWebSocket = self . WebSocket || self . MozWebSocket ;
4307
4311
}
4308
4312
4309
4313
/**
@@ -4312,7 +4316,7 @@ return /******/ (function(modules) { // webpackBootstrap
4312
4316
* interface exposed by `ws` for Node-like environment.
4313
4317
*/
4314
4318
4315
- var WebSocket = BrowserWebSocket || NodeWebSocket ;
4319
+ var WebSocketImpl = BrowserWebSocket || NodeWebSocket ;
4316
4320
4317
4321
/**
4318
4322
* Module exports.
@@ -4336,7 +4340,7 @@ return /******/ (function(modules) { // webpackBootstrap
4336
4340
this . usingBrowserWebSocket = BrowserWebSocket && ! opts . forceNode ;
4337
4341
this . protocols = opts . protocols ;
4338
4342
if ( ! this . usingBrowserWebSocket ) {
4339
- WebSocket = NodeWebSocket ;
4343
+ WebSocketImpl = NodeWebSocket ;
4340
4344
}
4341
4345
Transport . call ( this , opts ) ;
4342
4346
}
@@ -4396,7 +4400,7 @@ return /******/ (function(modules) { // webpackBootstrap
4396
4400
}
4397
4401
4398
4402
try {
4399
- this . ws = this . usingBrowserWebSocket && ! this . isReactNative ? protocols ? new WebSocket ( uri , protocols ) : new WebSocket ( uri ) : new WebSocket ( uri , protocols , opts ) ;
4403
+ this . ws = this . usingBrowserWebSocket && ! this . isReactNative ? protocols ? new WebSocketImpl ( uri , protocols ) : new WebSocketImpl ( uri ) : new WebSocketImpl ( uri , protocols , opts ) ;
4400
4404
} catch ( err ) {
4401
4405
return this . emit ( 'error' , err ) ;
4402
4406
}
@@ -4568,7 +4572,7 @@ return /******/ (function(modules) { // webpackBootstrap
4568
4572
*/
4569
4573
4570
4574
WS . prototype . check = function ( ) {
4571
- return ! ! WebSocket && ! ( '__initialize' in WebSocket && this . name === WS . prototype . name ) ;
4575
+ return ! ! WebSocketImpl && ! ( '__initialize' in WebSocketImpl && this . name === WS . prototype . name ) ;
4572
4576
} ;
4573
4577
4574
4578
/***/ } ,
0 commit comments