We changed to the UglifyJS2 compiler yesterday to eliminate the dependency on Closure in our environment. Why? Cause Java, that's why. We don't install Java on our build machines, it just happens to be there in a small way because we use TeamCity as our build system, so the agent itself is Java-based and contains a small JRE within. The conflict of required Java for the latest Closure vs. the version the agents were on was kinda the last straw there.
UglifyJS gives us more control, easier multithreading, and smaller files all at the same time...so that's nice.
Now, how does this break you? Diacritics. Here's the start of the code from Uglify that's breaking you (spaced out by me):
StackExchange.helpers.noDiacritics = function() {
var e = { à åáâäãåąÉᵄᶛ:"a",
æǣǽᴂᵆ:"ae",
çćÄĉ:"c",
ýŸÿʎ:"y",
IE8 isn't a fan of that ASCII in object literals keys, every other browser has no problem with it. A fix for this is rolling out now, by quoting those keys.
For those really curious, here's the changeset to fix such a thing in your own UglifyJS usage:
var compressor = uglify.Compressor();
function processJs(file, source, done) {
try {
- var ast = uglify.parse(source);
+ var ast = uglify.parse(source),
+ s = uglify.OutputStream({ quote_keys: true });
ast.figure_out_scope();
ast = ast.transform(compressor);
ast.figure_out_scope();
ast.compute_char_frequency();
ast.mangle_names();
- var code = ast.print_to_string();
+ ast.print(s);
+ var code = s.get();