If name_cache is specified, do rename cached properties
(even if --mangle-props is not there)
This commit is contained in:
@@ -63,7 +63,8 @@ function find_builtins() {
|
||||
function mangle_properties(ast, options) {
|
||||
options = defaults(options, {
|
||||
reserved : null,
|
||||
cache : null
|
||||
cache : null,
|
||||
only_cache : false
|
||||
});
|
||||
|
||||
var reserved = options.reserved;
|
||||
@@ -139,6 +140,9 @@ function mangle_properties(ast, options) {
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user