Is it possible to call the function locally defined in another function in JavaScript? I have a code pretty much like this:
var module = function () {
function inner() {
// Some code here
}
// Some code here
}
var originalModule = module;
var module = function () {
originalModule();
// inner() must be called here
}
So I'm overriding the original module implementation, but at some point in the new implementation I need to call inner() function. I cannot edit the original implementation. So far the only way I see is to copy inner() function from original and define it in the new one. Is there another way?