Is there any way to safely override eval? Have tried directly overriding:
var oldEval = global.eval;
global.eval = function(){
// my logic
global.a+=1;
return oldEval.apply(this, arguments);
}
This somehow gives the following reference err:
ReferenceError: createCallback is not defined
NOTE: Error here is not generated while overriding, but rather on some occurrences of call to eval. In other cases this works exactly as expected.
Please find the issue reproduction code here: https://runkit.com/embed/8hv0yp94on8s