Ever seen JSLint?  Same concept, different input.