(even if --mangle-props is not there)
TOPLEVEL = TOPLEVEL.wrap_enclose(arg_parameter_list);
}
- if (ARGS.mangle_props) (function(){
+ if (ARGS.mangle_props || ARGS.name_cache) (function(){
var reserved = RESERVED ? RESERVED.props : null;
var cache = readNameCache("props");
TOPLEVEL = UglifyJS.mangle_properties(TOPLEVEL, {
- reserved: reserved,
- cache: cache
+ reserved : reserved,
+ cache : cache,
+ only_cache : !ARGS.mangle_props
});
writeNameCache("props", cache);
})();
function mangle_properties(ast, options) {
options = defaults(options, {
reserved : null,
- cache : null
+ cache : null,
+ only_cache : false
});
var reserved = options.reserved;
// only function declarations after this line
function can_mangle(name) {
+ if (options.only_cache) {
+ return cache.props.has(name);
+ }
if (reserved.indexOf(name) >= 0) return false;
if (/^[0-9.]+$/.test(name)) return false;
return true;