Skip to content

Instantly share code, notes, and snippets.

@joewalker
Created February 24, 2011 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joewalker/842531 to your computer and use it in GitHub Desktop.
Save joewalker/842531 to your computer and use it in GitHub Desktop.
/**
* 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