Skip to content

Instantly share code, notes, and snippets.

@westc
Created February 26, 2014 23:13
Show Gist options
  • Save westc/9240810 to your computer and use it in GitHub Desktop.
Save westc/9240810 to your computer and use it in GitHub Desktop.
JavaScript code to make all functions appear to be native code.
(function(strFakeNative) {
Function.prototype.toString = function() {
return strFakeNative.replace('atob', this.name || '');
};
})(atob + '');
@westc
Copy link
Author

westc commented Feb 26, 2014

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. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment