Hi all, im trying for put a private var into an already existent function, example:
var AObject={
get:function(s){
return s.toLowerCase()+a;
}
}
function temp(){
var a="A";
var o={};
eval("o.get="+AObject.get.toString());
reurn o;
}
var bObject=temp();
BObject.get("B"); // "bA"
BObject.get(); /* error: s is undefined; but marked in line "return o;"
and not in "return s.toLowerCase()+a;"*/
My target is to run get() function, owned by an existent AObject, with private var ... Im obtain it using eval(or new Function), but unfortunly the debugger will be broke!
So, there is a way to achieve this without using eval, or a way to use eval and keep debugger useful?