IIRC, this is standard practice in XS JS libraries to prevent
accidental leakage of globals as well as a convenient way to have
'package' scoped variables.

-Ray


On Mon, Oct 27, 2008 at 2:14 PM, Lex Spoon <[EMAIL PROTECTED]> wrote:
>
> I looked today at making the code splitter work with the cross-site
> linker.  I got it working, but I had to undo one aspect of the current
> implementation, and I'm not sure what the correct change would be.
>
> Specifically, the cross-site linker wraps all of the JavaScript code
> into a function and then calls it.  This causes problems for code
> splitting because the code that is loaded later is in a different
> scope from the code that loaded first.  The code that loaded first is
> all inside an anonymous function.
>
> To make it work, I simply removed the function wrapper.  It sure looks
> like the wrapper was there for a reason, though.  Does anyone remember
> why?  It was there in the very first check-in of XSLinker.java, back
> in January of this year.  I didn't look further back, because I have
> no idea where to start to find the pre-linker equivalent.
>
> Lex
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to