diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2013-11-19 10:58:23 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2013-11-19 13:14:01 +0400 |
commit | fce0eb416b47f205605fe3dde47550dec337c673 (patch) | |
tree | 50e909fe998cc2fa7e1ee77876264f439f310701 /test | |
parent | 5885f464f0ad372efa7ef44a72df6d44acec3085 (diff) | |
download | node-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.js | 12 |
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'); |