summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-11-19 10:58:23 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2013-11-19 13:14:01 +0400
commitfce0eb416b47f205605fe3dde47550dec337c673 (patch)
tree50e909fe998cc2fa7e1ee77876264f439f310701 /test
parent5885f464f0ad372efa7ef44a72df6d44acec3085 (diff)
downloadnode-new-fce0eb416b47f205605fe3dde47550dec337c673.tar.gz
events: do not accept NaN in setMaxListeners
Diffstat (limited to 'test')
-rw-r--r--test/simple/test-event-emitter-max-listeners.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/simple/test-event-emitter-max-listeners.js b/test/simple/test-event-emitter-max-listeners.js
index 3dea94bccf..dfc3e1352d 100644
--- a/test/simple/test-event-emitter-max-listeners.js
+++ b/test/simple/test-event-emitter-max-listeners.js
@@ -38,4 +38,16 @@ e.on('maxListeners', function() {
// Should not corrupt the 'maxListeners' queue.
e.setMaxListeners(42);
+assert.throws(function() {
+ e.setMaxListeners(NaN);
+});
+
+assert.throws(function() {
+ e.setMaxListeners(-1);
+});
+
+assert.throws(function() {
+ e.setMaxListeners("and even this");
+});
+
e.emit('maxListeners');