Skip to content

Commit eb24245

Browse files
Aaron Carlinodarrachequesne
authored andcommitted
[fix] Define "requestsCount" var and "requests" hash unconditionally (#490)
There are situations in which `global.document` can be defined after the file is loaded, but before a request is created.
1 parent dc0d7d2 commit eb24245

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/transports/polling-xhr.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,10 @@ Request.prototype.abort = function () {
393393
* emitted.
394394
*/
395395

396+
Request.requestsCount = 0;
397+
Request.requests = {};
398+
396399
if (global.document) {
397-
Request.requestsCount = 0;
398-
Request.requests = {};
399400
if (global.attachEvent) {
400401
global.attachEvent('onunload', unloadHandler);
401402
} else if (global.addEventListener) {

0 commit comments

Comments
 (0)