Basically, you can't. The nested printMessage is limited to caller scope only.
You can access the caller constructor function by its calee.caller prototype but it's "locked" under caller's scope only..
Just for info:
function caller(func) {
function printMessage(message) {
console.log(message);
}
func();
}
function callee() {
//you can access the caller's constructor from prototype..
var callerFunc = arguments.callee.caller.prototype;
console.log(callerFunc);
//you can get the actual code
var code = arguments.callee.caller.toString();
console.log(code);
//but you can't invoke the nested function which is under
//caller scope only...will throw ReferenceError
printMessage('hello world');
}
caller(callee);
jsfiddle:
http://jsfiddle.net/ufxnoaL1/
Also, note that arguments.callee will not be supported and should not be used
Warning: The 5th edition of ECMAScript (ES5) forbids use of
arguments.callee() in strict mode. Avoid using arguments.callee() by
either giving function expressions a name or use a function
declaration where a function must call itself.
console, that wraps the implementation?