Perhaps:
try {
  // attempt to use console or set a 'console available' flag...
} catch(exp) {
  // handle not having console, if anything.
}

On Jun 29, 8:21 am, GFI Progiciels <[email protected]> wrote:
> Sure, that's why I'd like to test "if (console)", to have code working in
> both environments (Workers one and normal pages one).
>
> 2009/6/27 skye <[email protected]>
>
>
>
>
>
> > Basically none but pure built-in language features.  Workers are not
> > attached to the DOM/document/window, so you cant access the global
> > javascript space (where console is defined)
>
> > On Jun 24, 2:13 am, GFI Progiciels <[email protected]> wrote:
> > > Hello,
> > > I'm using WorkerPool, my worker works quite well ;
> > > but it seems that the following shortcut isn't working at all in workers
> > :
> > > *if (myvar)*
> > > for
> > > *if (typeof myvar!='undefined')*
>
> > > Indeed, I get the undefined exception when I write
> > > *if (console) {console.debug("xxx")}*
>
> > > Which parts of javascript aren't supported in WorkerPool  ??

Reply via email to