The Ashes
Technology, Science and other news
August 16, 2009
Detecting globals with a bookmarklet
Filed under : General
Kangax stumbled upon a blog post by Remy Sharp on detecting global variable leaks. He took that work and updated it a little to filter out Prototype, Script.aculo.us, Google and Mozilla globals.
If you want to add sets it is easy to do so… go fork away. The bookmarklet itself is here.
Of course:
It’s worth mentioning that JSLint already allows detecting undeclared assignments, but JSLint can hurt feelings so we won’t use it. Well, actually JSLint performs so many validations, that it’s not always possible to detect undeclared assignments in huge scripts of legacy applications (like the one I wanted to examine). Running a test such as in this bookmarklet can be “applied on” any script.
Tags :
No Comments