Created
February 24, 2011 17:45
-
-
Save joewalker/842531 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A combined status is the worser of the provided statuses. The statuses | |
* can be provided either as a set of arguments or a single array | |
*/ | |
combine: function() { | |
var combined = Status.VALID; | |
for (var i = 0; i < arguments; i++) { | |
var status = arguments[i]; | |
if (Array.isArray(status) { | |
status = Status.combine(status); | |
} | |
if (status > combined) { | |
combined = status; | |
} | |
} | |
return combined; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment