Hi
I would like to count the number of calls made to eval in our javascript application.
I came up with the following, but it generates errors. These errors are hard to track, and my knowledge of the app is limited.
Can you tell what is wrong with my code ?
increment = function (){
var me = arguments.callee;
if (!me.count) me.count = 0;
return ++me.count;
}
var oldEval = eval;
eval = function eval(string){
console.log('eval number ', increment());
return oldEval(string);
}
Or to you know an alternative way to count the use of eval ?
thanks
Olivier