/ Чужая библиотека /
function createInterface() {
var scoped_var = 123;
this.somefunc = function() {
return this.field + scoped_var + ext_call(456);
};
}
/ Мой код /
var obj = new createInterface();
//obj.somefunc = eval(obj.somefunc.toString().replace('456', '789'));
//obj.somefunc = (function(old) { return function() { var value = old.apply(obj); ... } })(obj.somefunc);