Wrong Function’s Caller in Opera

Maybe there is a bug in javascript engine in opera browser: It will optimize a function if it just calling other function, The second function’s caller will be point to itself. I wrote a sample:


function BB(){
document.write( BB.caller.toString() );
}

function AA(){
BB.apply( this , arguments );
}

function CALLAA(){
AA.apply( this , arguments )
}

CALLAA();

It should write “function AA(){}” but write “function BB(){}” in error.Just write anything in the function will correct it.

I test in Opera 12.14.

Notice that do not open the Dragonfly(Debugger), Everything is okay if you open it.I think the reason is the browser will stop optimizing in debug mode.

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.