Created
February 26, 2014 23:13
-
-
Save westc/9240810 to your computer and use it in GitHub Desktop.
JavaScript code to make all functions appear to be native code.
This file contains hidden or 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(strFakeNative) { | |
Function.prototype.toString = function() { | |
return strFakeNative.replace('atob', this.name || ''); | |
}; | |
})(atob + ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm truly not sure why you would ever want to use this function, but if you did you would ensure that any attempt to look at the inners of a function via string coercion would fail. 😄