On Jul 10, 8:20 am, timeless <[EMAIL PROTECTED]> wrote:
> On Jun 24, 6:15 am, James Newell <[EMAIL PROTECTED]> wrote:
>
> > Hi.
>
> > I have successfully set up threading in my application based on
> > skrul's thread demo extension. However with more complex code in the
> > threads, I get a very unexpected error. I am wondering if anyone has
> > come across this.
>
> > In my thread I try to instance a number of custom made JS components
> > in the run method of nsIRunnable.  All is well until I run my
> > application a second time (after changing the build id) and when I
> > attempt to instance my components, I get 3 errors for one component
> > but not the other components:
>
> > Error: too much recursion
>
> sorry, I should have offered the simpler solution. consider this:
> js> function a() {a()}
> js> function b() {try { a() } catch (e) { f=e } }
> js> b()
> js> f
> InternalError: too much recursion
> js> f.stack.split("\n").length
> 1002
>
> If you have some way of logging to a file (<http://www.webwizardry.net/
> ~timeless/console-logger.js> has some), then you can dump f.stack into
> a file and figure out what's going wrong.
>
> So, all you really have to do is stick trys around the contents of
> your main function bodies and have your catches dump to files (I'd
> suggest each catch use a distinct file name, probably named by the
> function it's in, the date, and nsIFile.createUnique or whatever it's
> called).

I found the Neil Mix's method of implementing threads in JavaScript
and it works with my components (http://www.neilmix.com/2007/02/07/
threading-in-javascript-17/). As I don't have time to fiddle I will
just be using this until I see fit to come back and play with this.

Thanks for all the help.

James

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to