On Mar 9, 2010, at 9:44 PM, Dave Land wrote:

The "anonymous function wrapper" ensures that the script's identifiers don't collide with identifiers in JavaScript in the page itself. All of the script's identifiers exist only within the anonymous function, so they can't "leak out" into the page, or vice versa — the script's identifiers are all local to the script.

And so forth...

I thought I could find where it is documented that this is an archaic way of writing GM scripts, but I can't find it now.

I wonder if someone can explain to us: does GM automatically wrap user scripts in an anonymous function (or the equivalent) to gain the security and scoping benefits I named above? Is it overkill to add the anon function in your own user scripts?

Dave


--
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to