Subj : Re: Looking for Spidermonkey equivalent of Mozilla/DOM trick... To : netscape.public.mozilla.jseng From : Anton van Straaten Date : Wed Nov 26 2003 05:37 pm Igor Bukanov wrote: > Anton van Straaten wrote: >> Since this program is already structured around setTimeout, I'm >> wondering if there are any easy tricks similar to setTimeout that I >> can use under Spidermonkey without DOM? I could implement a >> trampoline-style top-level loop and do this myself, I'm just looking >> for a lazy way out. > > > What about pure EcmaScript solution like: > > var functionToContinue = callTheProgram(); > while (functionToContinue != null) { > functionToContinue(); > } > > where you program instead of calling setTimeout and returning would > simply return function to continue that would be called from the top level? Thanks, that's more or less what I meant by a "trampoline-style top-level loop". It would work, but the problem in this case is that the program in question is not currently set up to do this, and would require some restructuring. So I was hoping for a shortcut... Anton .