JSHint likes it now

apart from whitespace inconsistency