engine.io-client
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -7,2 +7,3 @@ /** | ||
var inherit = require('component-inherit'); | ||
var globalThis = require('../globalThis'); | ||
@@ -35,11 +36,2 @@ /** | ||
/** | ||
* Until https://github.com/tc39/proposal-global is shipped. | ||
*/ | ||
function glob () { | ||
return typeof self !== 'undefined' ? self | ||
: typeof window !== 'undefined' ? window | ||
: typeof global !== 'undefined' ? global : {}; | ||
} | ||
/** | ||
* JSONP Polling constructor. | ||
@@ -60,4 +52,3 @@ * | ||
// we need to consider multiple engines in the same page | ||
var global = glob(); | ||
callbacks = global.___eio = (global.___eio || []); | ||
callbacks = globalThis.___eio = (globalThis.___eio || []); | ||
} | ||
@@ -64,0 +55,0 @@ |
@@ -12,2 +12,3 @@ /* global attachEvent */ | ||
var debug = require('debug')('engine.io-client:polling-xhr'); | ||
var globalThis = require('../globalThis'); | ||
@@ -407,3 +408,3 @@ /** | ||
} else if (typeof addEventListener === 'function') { | ||
var terminationEvent = 'onpagehide' in self ? 'pagehide' : 'unload'; | ||
var terminationEvent = 'onpagehide' in globalThis ? 'pagehide' : 'unload'; | ||
addEventListener(terminationEvent, unloadHandler, false); | ||
@@ -410,0 +411,0 @@ } |
// browser shim for xmlhttprequest module | ||
var hasCORS = require('has-cors'); | ||
var globalThis = require('./globalThis'); | ||
@@ -34,5 +35,5 @@ module.exports = function (opts) { | ||
try { | ||
return new self[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP'); | ||
return new globalThis[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP'); | ||
} catch (e) { } | ||
} | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"main": "lib/index.js", | ||
@@ -73,3 +73,4 @@ "homepage": "https://github.com/socketio/engine.io-client", | ||
"ws": false, | ||
"xmlhttprequest-ssl": "./lib/xmlhttprequest.js" | ||
"xmlhttprequest-ssl": "./lib/xmlhttprequest.js", | ||
"./lib/globalThis.js": "./lib/globalThis.browser.js" | ||
}, | ||
@@ -76,0 +77,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
179671
16
5734