@@ -129,7 +129,9 @@ function Compressor(options, false_by_default) {
|
||||
this.toplevel.funcs = /funcs/.test(toplevel);
|
||||
this.toplevel.vars = /vars/.test(toplevel);
|
||||
} else {
|
||||
this.toplevel = toplevel ? return_true : return_false;
|
||||
this.toplevel = toplevel ? function(def) {
|
||||
return !def.export;
|
||||
} : return_false;
|
||||
this.toplevel.funcs = this.toplevel.vars = toplevel;
|
||||
}
|
||||
var sequences = this.options["sequences"];
|
||||
@@ -141,6 +143,7 @@ Compressor.prototype = new TreeTransformer;
|
||||
merge(Compressor.prototype, {
|
||||
option: function(key) { return this.options[key] },
|
||||
toplevel: function(def) {
|
||||
if (def.export) return false;
|
||||
for (var i = 0, len = def.orig.length; i < len; i++)
|
||||
if (!this.toplevel[def.orig[i] instanceof AST_SymbolDefun ? "funcs" : "vars"])
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user