In this code I a created a function called someFunction. thenThen I Modifiedmodified Function.prototype.apply and call methods. soSo instead of my function code is working I am runingrunning my interception code. (which shows an alert). But neighterneither "call" nor "apply" intercepts direct method call. isIs it possiple to intercept this?
<html>
<head>
<script type="text/javascript" src="logger.js"></script>
<script type="text/javascript">
Function.prototype.call = function(){alert("call");};
Function.prototype.apply = function(){alert("apply");};
function someFunction(){}
logger.enableLog = true;
window.onload = function(){
someFunction.call(this); //call alert is shown
someFunction.apply(this); //apply alert is shown
someFunction(); //how can I intercept this.?
}
</script>
</head>
<body>
</body>
</html>