If name_cache is specified, do rename cached properties

(even if --mangle-props is not there)
This commit is contained in:
Mihai Bazon
2015-04-22 17:34:49 +03:00
parent 3b14582d6b
commit 7b22f2031f
2 changed files with 9 additions and 4 deletions

View File

@@ -372,12 +372,13 @@ async.eachLimit(files, 1, function (file, cb) {
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);
})();