On Nov 19, 4:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Nov 19, 3:11 pm, SCWells72 <[EMAIL PROTECTED]> wrote: > Rhino provides a way to be notified when a certain instruction count > threshold > has been reached and you can react on that. What we do is we throw an > exception > that can't be caught when the time limit is reached.You'll want to > subclass ContextFactory and > call setInstrutionObserverThreshold,and then implement an > observerInstructionCount method. What we do > is note the initial time on execution, and then check if the time > difference between the initial time and the current > time has exceed our limit, and if it has we. throw an exception. > Ahh! Just remembered the trick we use is to throw a java.lang.Error instead of just a plain-old exception. Then the user scripts won't be able to catch it.
Alex _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
