jit icon indicating copy to clipboard operation
jit copied to clipboard

window.$jit - Web Workers issue

Open pedrofaustino opened this issue 14 years ago • 0 comments

Hi there!

Is there a reason why JIT uses window.$jit to define $jit as a global variable? Can't we define $jit outside the anonymous function with "var $jit" (as YUI does, see http://www.yuiblog.com/blog/2006/06/01/global-domination/#comment-45762)?

I want to use some of the operations provided by $jit on an already created Spacetree from a Web Worker, and when I try to load it from the worker script using importScripts, of course it complains about the window.$jit statement.

At the moment I have the following hack in place, but would really like to have something more elegant: if(!importScripts) $jit = window.$jit;

I know that Extras.js and in other places there are references to window, but I won't be using those functions anyways.

Thanks

pedrofaustino avatar Dec 23 '11 00:12 pedrofaustino