history.js
history.js copied to clipboard
Script should end with ;
The entire minified script should always end with a ";" - caused me unbelievable pain when trying to combine all my JS output into one file. Loads fine by itself though.
I had the same problem (with Ruby + Sinatra + AssetPack + Uglifier). The compressed version creates a garbage output JS file ("undefined is not a function"). My fix was instead to use the uncompressed version because it gets minified into the aggregate JS file just fine.
Still, I would have definitely preferred not having to care. I could see how this would confuse & frustrate a newbie enough to scare them off.
+1. We had the same problem. Scripts should end in a semicolon since otherwise they may break things if repackaged into a larger script, which is fairly common.
I agree with @robinetmiller, both that the uncompressed version works, and that it's nice if we don't have to care.
You can reproduce the issue by pasting the minified script into a JS file followed by a newline (optional) followed by "(function() {})();" or similar.
Ah, this was driving me crazy. Definitely should end with ;