Fix mangle collision with cache reuse across runs
This commit is contained in:
parent
6f3f21233f
commit
58728e1880
|
|
@ -114,7 +114,8 @@ function mangle_properties(ast, options) {
|
||||||
if (cache == null) {
|
if (cache == null) {
|
||||||
cache = {
|
cache = {
|
||||||
cname: -1,
|
cname: -1,
|
||||||
props: new Dictionary()
|
props: new Dictionary(),
|
||||||
|
props_inv: new Dictionary()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -214,10 +215,11 @@ function mangle_properties(ast, options) {
|
||||||
if (!mangled) {
|
if (!mangled) {
|
||||||
do {
|
do {
|
||||||
mangled = base54(++cache.cname);
|
mangled = base54(++cache.cname);
|
||||||
} while (!can_mangle(mangled));
|
} while (!can_mangle(mangled) || cache.props_inv.get(mangled));
|
||||||
}
|
}
|
||||||
|
|
||||||
cache.props.set(name, mangled);
|
cache.props.set(name, mangled);
|
||||||
|
cache.props_inv.set(mangled, name);
|
||||||
}
|
}
|
||||||
return mangled;
|
return mangled;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user