added test2.caller to the test code.
Code:
function test2()
{
msg('Test 2');
msg('arguments.caller = ' + arguments.caller);
msg('test2.caller = ' + test2.caller);
msg('arguments.callee = ' + arguments.callee);
msg('test2.callee = ' + test2.callee);
msg('test2.caller = ' + test2.caller);
}
Looks like Opera9 supports neither Function.prototype.caller nor arguments.caller. Although arguments.caller was deprecated, Function.prototype.caller was not.
I don't know of any another way to reference the caller.
Safari: Result is the same as Opera.
Code:
Test 2
arguments.caller = undefined
test2.caller = undefined
arguments.callee = function test2() { msg("Test 2"); msg("arguments.caller = "+arguments.caller); msg("test2.caller = "+test2.caller); msg("arguments.callee = "+arguments.callee); msg("test2.callee = "+test2.callee); msg("test2.caller = "+test2.caller); }
test2.callee = undefined
test2.caller = undefined
Bookmarks