Browse Source

test: fix test-net-* variable redeclarations

PR-URL: https://github.com/nodejs/node/pull/4989
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
v4.x
Rich Trott 9 years ago
committed by Myles Borins
parent
commit
52335f0100
  1. 6
      test/parallel/test-net-socket-timeout.js

6
test/parallel/test-net-socket-timeout.js

@ -10,19 +10,19 @@ var nonNumericDelays = ['100', true, false, undefined, null, '', {}, noop, []];
var badRangeDelays = [-0.001, -1, -Infinity, Infinity, NaN]; var badRangeDelays = [-0.001, -1, -Infinity, Infinity, NaN];
var validDelays = [0, 0.001, 1, 1e6]; var validDelays = [0, 0.001, 1, 1e6];
for (var i = 0; i < nonNumericDelays.length; i++) { for (let i = 0; i < nonNumericDelays.length; i++) {
assert.throws(function() { assert.throws(function() {
s.setTimeout(nonNumericDelays[i], noop); s.setTimeout(nonNumericDelays[i], noop);
}, TypeError); }, TypeError);
} }
for (var i = 0; i < badRangeDelays.length; i++) { for (let i = 0; i < badRangeDelays.length; i++) {
assert.throws(function() { assert.throws(function() {
s.setTimeout(badRangeDelays[i], noop); s.setTimeout(badRangeDelays[i], noop);
}, RangeError); }, RangeError);
} }
for (var i = 0; i < validDelays.length; i++) { for (let i = 0; i < validDelays.length; i++) {
assert.doesNotThrow(function() { assert.doesNotThrow(function() {
s.setTimeout(validDelays[i], noop); s.setTimeout(validDelays[i], noop);
}); });

Loading…
Cancel
Save