Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Return true when calling _.all on empty array. #5

Closed
wants to merge 1 commit into from

2 participants

@jiaweihli
Collaborator

This is the expected behavior when using underscore.js.

@amacdougall
Owner

Thanks for the pull request! I'll add a test case for this and merge it soon. Right now I'm just getting back into working condition after a hurricane knocked out power to half of Manhattan.

@amacdougall amacdougall closed this pull request from a commit
@amacdougall Merge remote-tracking branch 'jiaweihli/master'
Fixes #5, satisfying pull request 5.
0e90c6b
@amacdougall
Owner

Done! Sorry it took me so long to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 25, 2012
  1. @jiaweihli
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/com/alanmacdougall/underscore/_.as
View
2  src/com/alanmacdougall/underscore/_.as
@@ -202,7 +202,7 @@ public var _:* = (function():Function {
* iterator is omitted, tests the elements themselves for truthiness.
*/
_.all = function(obj:*, iterator:Function = null, context:Object = null):Boolean {
- if (obj == null || _(obj).isEmpty()) return false;
+ if (obj == null) return false;
// TO DO: benchmark native Array.every
iterator = iterator || identity;
var result:Boolean = true;
Something went wrong with that request. Please try again.