Skip to content

Commit

Permalink
events: improve for-loop
Browse files Browse the repository at this point in the history
PR-URL: #26354
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
gengjiawen authored and BethGriggs committed Apr 16, 2019
1 parent e418b4f commit e1f293c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,7 @@ EventEmitter.prototype.removeAllListeners =

// emit removeListener for all listeners on all events
if (arguments.length === 0) {
var keys = Object.keys(events);
var key;
for (i = 0; i < keys.length; ++i) {
key = keys[i];
for (const key of Object.keys(events)) {
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
Expand Down

0 comments on commit e1f293c

Please sign in to comment.