var result = UglifyJS.minify(original_code, m);
if (result.error) {
errorln("Error testing options." + component + "." + name);
- errorln(result.error);
+ errorln(result.error.stack);
} else {
var r = sandbox.run_code(result.code);
return sandbox.same_stdout(original_result, r);
}
});
if (suspects.length > 0) {
- errorln("Suspicious", component, "options:");
+ errorln("Suspicious " + component + " options:");
suspects.forEach(function(name) {
errorln(" " + name);
});
function log(options) {
if (!ok) errorln('\n\n\n\n\n\n!!!!!!!!!!\n\n\n');
errorln("//=============================================================");
- if (!ok) errorln("// !!!!!! Failed... round", round);
+ if (!ok) errorln("// !!!!!! Failed... round " + round);
errorln("// original code");
try_beautify(original_code, original_result, errorln);
errorln();
errorln();
errorln();
errorln("original result:");
- errorln(original_result);
+ errorln(typeof original_result == "string" ? original_result : original_result.stack);
errorln("uglified result:");
- errorln(uglify_result);
+ errorln(typeof uglify_result == "string" ? uglify_result : uglify_result.stack);
} else {
errorln("// !!! uglify failed !!!");
errorln(uglify_code.stack);
}
errorln("minify(options):");
options = JSON.parse(options);
- errorln(options);
+ errorln(JSON.stringify(options, null, 2));
errorln();
if (!ok && typeof uglify_code == "string") {
Object.keys(default_options).forEach(log_suspects.bind(null, options));
- errorln("!!!!!! Failed... round", round);
+ errorln("!!!!!! Failed... round " + round);
}
}
println();
println();
println("original result:");
- println(original_result);
+ println(original_result.stack);
println();
}
if (!ok && isFinite(num_iterations)) {