unmangleable: function(options) {
return this.global
|| this.undeclared
- || (!options.eval && (this.scope.uses_eval || this.scope.uses_with));
+ || (!(options && options.eval) && (this.scope.uses_eval || this.scope.uses_with));
},
mangle: function(options) {
if (!this.mangled_name && !this.unmangleable(options))
return this.definition().global;
});
-AST_Toplevel.DEFMETHOD("mangle_names", function(options){
- options = defaults(options, {
+AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options){
+ return defaults(options, {
except : [],
eval : false,
});
+});
+
+AST_Toplevel.DEFMETHOD("mangle_names", function(options){
+ options = this._default_mangler_options(options);
// We only need to mangle declaration nodes. Special logic wired
// into the code generator will display the mangled name if it's
// present (and for AST_SymbolRef-s it'll use the mangled name of
});
AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options){
+ options = this._default_mangler_options(options);
var tw = new TreeWalker(function(node){
if (node instanceof AST_Constant)
base54.consider(node.print_to_string());