Skip to content

Commit

Permalink
Closes EventEmitter2#153 by using the current global scope instead of…
Browse files Browse the repository at this point in the history
… window
  • Loading branch information
DigitalBrainJS committed Mar 11, 2020
1 parent 799d2f8 commit aff60a1
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 @@ -782,7 +782,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 aff60a1

Please sign in to comment.