Skip to content

Commit

Permalink
Closes #153 by using the current global scope instead of window (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalBrainJS committed Mar 20, 2020
1 parent 6ad3cdc commit a5f9348
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/eventemitter2.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,8 @@
module.exports = EventEmitter;
}
else {
// Browser global.
window.EventEmitter2 = EventEmitter;
// global for any kind of environment.
var _global= new Function('','return this')();
_global.EventEmitter2 = EventEmitter;
}
}();

0 comments on commit a5f9348

Please sign in to comment.