We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f78487c commit 3a3015eCopy full SHA for 3a3015e
lib/browser.js
@@ -1,9 +1,12 @@
1
-var _global = (function () {
2
- if (!this && typeof global !== 'undefined') {
3
- return global;
4
- }
5
- return this;
6
-})();
+var _global;
+try {
+ _global = require('es5-ext/global');
+} catch (error) {
+} finally {
+ if (!_global && typeof window !== 'undefined') { _global = window; }
7
+ if (!_global) { throw new Error('Could not determine global this'); }
8
+}
9
+
10
var NativeWebSocket = _global.WebSocket || _global.MozWebSocket;
11
var websocket_version = require('./version');
12
package.json
@@ -28,6 +28,7 @@
28
},
29
"dependencies": {
30
"debug": "^2.2.0",
31
+ "es5-ext": "^0.10.50",
32
"nan": "^2.14.0",
33
"gulp": "^4.0.2",
34
"typedarray-to-buffer": "^3.1.5",
0 commit comments