There is arguments.callee.callerone that refers to a function that calls the function in which you access this property. arguments.callee- the function itself.
It is impossible to get the volume of the original function without passing it. In the following example, you cannot determine the value thisinside foo(except that nothing special happens here this):
function foo() {
bar();
}
function bar() {
console.log(arguments.callee);
console.log(arguments.callee.caller);
}
foo();
Documentation
, , : http://jsfiddle.net/pimvdb/6C47r/.
function foo() {
bar();
}
function bar() {
try { throw new Error; }
catch(e) {
console.log(e.stack);
}
}
foo();
Chrome - : :
Error
at bar (http://fiddle.jshell.net/pimvdb/6C47r/show/:23:17)
at foo (http://fiddle.jshell.net/pimvdb/6C47r/show/:19:5)
at http://fiddle.jshell.net/pimvdb/6C47r/show/:29:1