Hacker News new | ask | show | jobs
by sashthebash 5246 days ago
Related question... what do you do when the execution of your script just aborts without an error?

This happens sometimes to me, especially when I bundle all my JS resources together into one file. JSLint doesn't help, as some 3rd party libraries don't pass JSLint tests.

What I end up doing is adding console.log/alert statements all the way through the scripts to narrow down where the script aborts. There must be a better way?!?

1 comments

Try Closure Compiler instead of JSLint. It will catch your syntax errors without being so opinionated.

If you don't need Closure's minified output, don't use it; the error messages are still nice.

If you don't want to drop Closure into your app's JS build chain, use a Makefile for quick syntax checks: http://pastebin.com/raw.php?i=cqX165iD