dtao/lazy.js — pull request #32 by qiemem (2013-08-16 00:28:02+00:00)
Title: Fix take(0)'s behavior on GeneratedSequences and test.

`take(0)` on a `GeneratedSequence` would resulted in a nonempty sequence. For example:

> Lazy.generate(function (i) { return i; }).take(0).toArray()
[ 0 ]

As a consequence, ranges that should be empty weren't:

> Lazy.range(0).toArray()
[ 0 ]
> Lazy.range(5, 0).toArray()
[ 5 ]

This contradicts the behavior on other sequences:

> Lazy([1,2,3]).take(0).toArray()
[]

I assume the behavior on other sequences is correct. It makes more sense and matches underscore and lodash.

This pull request fixes the behavior and adds tests on both `range` and `generate`.

By the way, I noticed `compile:all` changed a bunch of files that weren't usually changed in you commits. `compile:lib` also changed lazy.min.js, which doesn't appear to be usually changed by your commits either. So I only added the files I changed and lazy.js. Let me know if you would prefer something different.