I need to override some behaviour of function, that goes after it calls other function. The problem is that this parent function is a library and I dont want to change it, so solutions like make some flag or another change of this function is not so good. I know that I got an caller object in function that I can change, so maybe I can figure out smth with it. Heres the example:
function parent()
{
console.log("some need stuff");
some.handler.function.from.config.that.i.can.change();
console.log("need omit this right till the end");
}
function child()
{
console.log("need to somehow stop evaluation of " + child.caller + " function");
}
As a ruby programmer I know there is lambdas with which you can terminate evaluation from inner scope of closure. But Im not sure how to do this from javascript.