Jsure, a static Javascript analyzer, checks syntax, catches undeclared variables and bad regexes.
jsure.org