Permalink
Browse files

times errors with wrong arguments

  • Loading branch information...
1 parent f4fba65 commit e04e0238fe58fec18d838cd038ee3f807560eb10 @dominictarr committed May 17, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 objects.js
View
@@ -60,7 +60,8 @@ var times = exports.times = function () {
i = 'number' === typeof i ? i : 1
diff = j ? j - i : 1
dir = i < m
-
+ if(m == i)
+ throw new Error('steps cannot be the same: '+m+', '+i)
for (; dir ? i <= m : m <= i; i += diff)
a.push(iterator(i))
return a
@@ -154,7 +155,7 @@ diff = exports.diff = function (old, nw) {
each(ab, function (ignore, k) {
//if the property is not in the new object, it must have been deleted.
- if (nw[k] == null)
+ if (nw[k] == null)
s[k] = null //null on a diff means to delete that property.
else if ('object' === typeof nw[k] && 'object' === typeof old[k] && old[k])
s[k] = diff(old[k], nw[k])
@@ -252,4 +253,4 @@ var enqueue = exports.enqueue = function (queue, value) {
if(!~queue.indexOf(value))
return queue.push(value), true
return false
-}
+}

0 comments on commit e04e023

Please sign in to comment.