http://code.google.com/p/js2-mode/
Mind you it won't catch globals declared in chained assignments
eg
var x = y = 0; // y is defined globally
http://code.google.com/p/js2-mode/
Mind you it won't catch globals declared in chained assignments
eg