Real bugs found by the Closure JavaScript Compiler

about | archive

[ 2014-April-03 10:10 ]

Google's big web apps like Gmail, Maps, and Calendar, use the Closure Compiler to minify and type check their JavaScript. Since my current theory is that type checking makes it faster to develop large software, I figured a good experiment would be to run the Closure compiler on Mitro's JavaScript (a few thousand lines). The summary is that it found real bugs, but they were all in rarely executed error paths, or cross-browser issues that our testing hadn't noticed yet. Perhaps the most valuable part is that when we rearrange JavaScript files, it finds duplicate or missing includes (script tag references). I found the Closure compiler annoying to get working, however now that I understand how to make it work, if I were to start a new, large JavaScript project from scratch, I would try to use it from the beginning. Below is a summary of the bugs it found in our code.