You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use UglifyJS to compress and mangle my JS and stick it in a bookmarklet.
This is the bookmarklet's JS (the anon function is to make sure it evaluates to undefined):
(function() {
/*bookmarklet stuff*/
})();
This is the JS after compression (notice the exclamation point):
!function(){/*bookmarklet stuff*/}();
The exclamation point negates the return value of the anon function so instead of evaluating to undefined, it will evaluate to true. Then when I prepend the javascript: "protocol" the bookmarklet instead navigates to a blank page displaying true.
IMO UglifyJS shouldn't negate anonymous functions if the return value is used or in this case if the function is the root function.