Given the increasing importance of JavaScript, I'm surprised there has not been more research into static type inference of JavaScript code (for compile-time type checking, not JIT code generation). I've only seen a couple academic papers on the subject. I see now that Unity 3D's game tools and Google's "Closure Compiler" support some type inference.