Created
August 19, 2014 12:22
-
-
Save zapthedingbat/642f71fa58aafc5db691 to your computer and use it in GitHub Desktop.
Log every function call to the console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var call = Function.prototype.call; | |
Function.prototype.call = function() { | |
console.log(this, arguments); | |
return call.apply(this, arguments); | |
}; | |
}()); |
@jelnur just include the file on the page.or just put the code top of your script file
@madhwa-se thanks I'll give it a try
console.log uses proto.call, which doesnt work at all
Doesn't work. :/
(function() {
function hi() {
}
var call = Function.prototype.call;
Function.prototype.call = function() {
console.log("hi", this, arguments);
return call.apply(this, arguments);
};
hi();
}());
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry for stupid question, but how to use it?