Created
February 8, 2012 18:07
-
-
Save ismyrnow/1771836 to your computer and use it in GitHub Desktop.
Overriding a global function in JS
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
// Overrides "some_function" | |
some_function = function () { | |
var orig_function = some_function; | |
return function () { | |
// call the original function | |
orig_function.apply(this, arguments); | |
// do other stuff | |
}; | |
} (); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment