Javascript exception - Too deep recursion???

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Javascript exception - Too deep recursion???

Ritesh Trivedi
Hi,

I am getting the following exception for a block of javascript in  a
page. Any help will be greatly appreciated....

Script source while executing is


function ebEventNotify(pSequence)
{
       with(this)
       {
               var a=arguments,len=a.length,aStr="";
               for(var i=1;i<len;i++)
                   aStr+=",a["+i+"]";

               var
l=aListeners[pSequence],len=l.length,rv,fn="_listener_",lp="l[i].parent.";
       for(i=0;i<len;i++)
       {

eval(lp+fn+"="+lp+l[i].sEventFunction+";rv="+lp+"_exec(fn,this"+aStr+");");
               if(!rv&&l[i].bBlocking)
                       return false;
       }
       }
   return true;
}

and following is an exception.... You can also get the script source
as shown in the exception trace (ebaybase_e4312us.js)

org.mozilla.javascript.EvaluatorException: Too deep recursion while
parsing
(<a href="http://include.ebaystatic.com/js/e431/us/ebaybase_e4312us.js#132(eval)#1">http://include.ebaystatic.com/js/e431/us/ebaybase_e4312us.js#132(eval)#1)
       at
com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.runtimeError(StrictErrorReporter.java:114)
       at
org.mozilla.javascript.Context.reportRuntimeError(Context.java:1054)
       at org.mozilla.javascript.Parser.parse(Parser.java:354)
       at org.mozilla.javascript.Parser.parse(Parser.java:287)
       at org.mozilla.javascript.Context.compileImpl(Context.java:2349)
       at
org.mozilla.javascript.Context.compileString(Context.java:1372)
       at
org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2202)
       at
org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2071)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2922)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164)
       at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140)
       at
org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2217)
       at
org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2071)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2922)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164)
       at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140)
       at
org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2217)
       at
org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2071)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2922)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164)
       at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140)
       at
org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2217)
       at
org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2071)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2922)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164)
       at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140)
       at
org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2217)
       at
org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2071)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2922)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164)
       at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140)
       at
org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2217)
       at
org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2071)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2922)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164)
       at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140)
       at
org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2217)
       at
org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2071)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2922)
       at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164)
       at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140)

_______________________________________________
mozilla-jseng mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-jseng
Reply | Threaded
Open this post in threaded view
|

Re: Javascript exception - Too deep recursion???

Alejandro Torras
[hidden email] wrote:
> Hi,
>
> I am getting the following exception for a block of javascript in  a
> page. Any help will be greatly appreciated....
>
[...]
>        for(i=0;i<len;i++)
>        {
>
> eval(lp+fn+"="+lp+l[i].sEventFunction+";rv="+lp+"_exec(fn,this"+aStr+");");
>                if(!rv&&l[i].bBlocking)
>                        return false;
>        }
[...]

> org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2922)
>        at
> org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164)
>        at
> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140)
>        at
> org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2217)
>        at
> org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2071)
>        at
> org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2922)
>        at
> org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164)
>        at
> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140)
>
Hi Ritesh,

Looking at my crystal ball, I think that it could be that the parameters
passed to the eval function  makes an indirect recursive call to
ebEventNotify or a self "eval" recursive call.

Maybe you are triggering some change that calls a listener and thus
ebEventNotify...

--
Alejandro Torras
http://dynamic-interactive.com
_______________________________________________
mozilla-jseng mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-jseng