philogb/jit — Issue #96: window.$jit - Web Workers issue
Author: pedrofaustino
Created: 2011-12-23 00:11:52+00:00
State: open

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