Friday, August 14th, 2009

Detecting globals with a bookmarklet

Category: Utility

<>p>

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.

Posted by Dion Almaer at 6:04 am
3 Comments

+++--
3.5 rating from 11 votes

3 Comments »

Comments feed TrackBack URI

Got any references that discuss the memory leaks? I have to admit I wasn’t even aware of it.

Comment by igitur — August 14, 2009

Total “amount” of properties. *grin*

Comment by igitur — August 14, 2009

@igitur
That was weird indeed :) Thanks, should be fixed now.

Comment by kangax — August 14, 2009

Leave a comment

You must be logged in to post a comment.