[Greasemonkey] Backups and sharing GM installs on multiplemachines

Aaron Boodman zboogs at gmail.com
Mon Apr 4 23:38:47 EDT 2005


You didn't declare the variable.

A very unfortunate wart in javascript's design is that undeclared
variables are global by default instead of local. It's considered very
bad form for this reason to use variables that weren't declared with
"var".

On Apr 4, 2005 9:28 PM, Edward Lee <edilee at gmail.com> wrote:
> On Apr 4, 2005 11:22 PM, Jeremy Dunck <jdunck at gmail.com> wrote:
> > With Aaron's most recent patch, a user script doesn't pollute the
> > global namespace at all, unless they specifically set a variable using
> > window.foo = bar.
> 
> Really? Is it just the anonymous function wrapper? I've been using..
> 
> (function() {
>   d = document;
> })();
> 
> And d is still set. Just that functions are lost when leaving the
> anonymous function.
> 
> --
> Ed
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>


More information about the Greasemonkey mailing list