if (typeof options != "object") options = {};
var defs = default_options[component];
var suspects = Object.keys(defs).filter(function(name) {
- if ((name in options ? options : defs)[name]) {
+ var flip = name == "keep_fargs";
+ if (flip ? name in options : (name in options ? options : defs)[name]) {
var m = JSON.parse(JSON.stringify(minify_options));
var o = JSON.parse(JSON.stringify(options));
- o[name] = false;
+ o[name] = flip;
m[component] = o;
var result = UglifyJS.minify(original_code, m);
if (result.error) {
}
}
+function log_rename(options) {
+ if (!options.rename) return;
+ var m = JSON.parse(JSON.stringify(minify_options));
+ m.rename = false;
+ var result = UglifyJS.minify(original_code, m);
+ if (result.error) {
+ errorln("Error testing options.rename");
+ errorln(result.error.stack);
+ } else {
+ var r = sandbox.run_code(result.code);
+ if (sandbox.same_stdout(original_result, r)) {
+ errorln("Suspicious options:");
+ errorln(" rename");
+ errorln();
+ }
+ }
+}
+
function log(options) {
if (!ok) errorln('\n\n\n\n\n\n!!!!!!!!!!\n\n\n');
errorln("//=============================================================");
errorln();
if (!ok && typeof uglify_code == "string") {
Object.keys(default_options).forEach(log_suspects.bind(null, options));
+ log_rename(options);
errorln("!!!!!! Failed... round " + round);
}
}