Skip to content
Permalink
Browse files

test: fix redeclared test-event-emitter-* vars

PR-URL: #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 rvagg committed Jan 31, 2016
1 parent 87b27c9 commit 83da19aa48e4bc8d3c3f740ec6233651a656d0d7
@@ -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'));
@@ -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'));
@@ -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'));
@@ -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'));
@@ -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

0 comments on commit 83da19a

Please sign in to comment.
You can’t perform that action at this time.