Skip to content

Commit

Permalink
test: fix redeclared test-event-emitter-* vars
Browse files Browse the repository at this point in the history
PR-URL: nodejs#4985
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
  • Loading branch information
Trott authored and Michael Scovetta committed Apr 2, 2016
1 parent 5b49979 commit 5356a5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-event-emitter-check-listener-leaks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var events = require('events');
var e = new events.EventEmitter();

// default
for (var i = 0; i < 10; i++) {
for (let i = 0; i < 10; i++) {
e.on('default', function() {});
}
assert.ok(!e._events['default'].hasOwnProperty('warned'));
Expand All @@ -15,7 +15,7 @@ assert.ok(e._events['default'].warned);

// specific
e.setMaxListeners(5);
for (var i = 0; i < 5; i++) {
for (let i = 0; i < 5; i++) {
e.on('specific', function() {});
}
assert.ok(!e._events['specific'].hasOwnProperty('warned'));
Expand All @@ -31,7 +31,7 @@ assert.ok(e._events['only one'].hasOwnProperty('warned'));

// unlimited
e.setMaxListeners(0);
for (var i = 0; i < 1000; i++) {
for (let i = 0; i < 1000; i++) {
e.on('unlimited', function() {});
}
assert.ok(!e._events['unlimited'].hasOwnProperty('warned'));
Expand All @@ -40,7 +40,7 @@ assert.ok(!e._events['unlimited'].hasOwnProperty('warned'));
events.EventEmitter.defaultMaxListeners = 42;
e = new events.EventEmitter();

for (var i = 0; i < 42; ++i) {
for (let i = 0; i < 42; ++i) {
e.on('fortytwo', function() {});
}
assert.ok(!e._events['fortytwo'].hasOwnProperty('warned'));
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-event-emitter-listeners-side-effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ require('../common');
var assert = require('assert');

var EventEmitter = require('events').EventEmitter;
var assert = require('assert');

var e = new EventEmitter();
var fl; // foo listeners
Expand Down

0 comments on commit 5356a5c

Please sign in to comment.