From 446e149105a69c8fd40437fd149eb00a2bab9b10 Mon Sep 17 00:00:00 2001 From: Marco Rogers Date: Sun, 12 Aug 2012 03:50:50 -0400 Subject: [PATCH] multitimer throws on too many stops --- tests/timers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/timers.js b/tests/timers.js index 9c4402d..928128f 100644 --- a/tests/timers.js +++ b/tests/timers.js @@ -16,8 +16,11 @@ exports.multiTimer = function(stops, delay, msg) { var t = exports.timer(delay, msg) t._stop = t.stop t.stop = function() { - if(!--stops) { + --stops + if(stops === 0) { t._stop() + } else if (stops < 0) { + throw new Error('Too many timer stops') } }