Function Instrumentation

You can now have any (public or privileged) function give you a stacktrace when it is called:

functionlogStackTrace(stack){console.log(stack.join('\n'));}varp=newprintStackTrace.implementation();p.instrumentFunction(this,'baz',logStackTrace);functionfoo(){vara=1;bar();}functionbar(){baz();}foo();//Will log a stacktrace when 'baz()' is called containing 'foo()'!p.deinstrumentFunction(this,'baz');//Remove function instrumentation