From 7ea34fd62418bcfd9a454ccc43cdacd0c64a7513 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 30 Jan 2016 20:16:14 -0800 Subject: [PATCH] test: fix redeclared test-event-emitter-* vars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/4985 Reviewed-By: James M Snell Reviewed-By: Johan Bergström Reviewed-By: Michaël Zasso --- test/parallel/test-event-emitter-check-listener-leaks.js | 8 ++++---- .../parallel/test-event-emitter-listeners-side-effects.js | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-event-emitter-check-listener-leaks.js b/test/parallel/test-event-emitter-check-listener-leaks.js index 3c8260e787..1e357cd027 100644 --- a/test/parallel/test-event-emitter-check-listener-leaks.js +++ b/test/parallel/test-event-emitter-check-listener-leaks.js @@ -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')); diff --git a/test/parallel/test-event-emitter-listeners-side-effects.js b/test/parallel/test-event-emitter-listeners-side-effects.js index 5b9f2f3ddf..355ec5262c 100644 --- a/test/parallel/test-event-emitter-listeners-side-effects.js +++ b/test/parallel/test-event-emitter-listeners-side-effects.js @@ -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