Hm... that's indeed a problem. Without looking at the code, I actually have an idea why it doesn't work. Continuations work only within a single invocation of Rhino's stackless interpreter loop. If you call out of the interpreter loop into Java code (which call() and apply() will do), and then back into a new instance of interpreter loop (which an interpreted function will do to run its implementation), a continuation will not work correctly. It can only capture/unwind within the current interpreter loop invocation.
It'd be possible to apply a bit of a trickery in interpreter loop to detect when call/apply is invoked for an InterpretedFunction instance, and run it in the current interpreter loop. Attila. -- home: http://www.szegedi.org weblog: http://constc.blogspot.com On 2007.11.22., at 17:03, Thomas wrote: > I'm heavily using continuations and noticed that they don't work > correctly > if my code uses the call() or apply() functions on Function objectes > to > invoke a function. Just wondering if anybody had similar experience? _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
