Friday, August 14th, 2009
Detecting globals with a bookmarklet
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.





Got any references that discuss the memory leaks? I have to admit I wasn’t even aware of it.
Total “amount” of properties. *grin*
@igitur
That was weird indeed :) Thanks, should be fixed now.