Make reserved names take priority over the name cache

This commit is contained in:
Mihai Bazon
2015-05-07 15:01:16 +03:00
parent e637bdaf4e
commit e48db3a8b6

View File

@@ -140,10 +140,10 @@ function mangle_properties(ast, options) {
// only function declarations after this line // only function declarations after this line
function can_mangle(name) { function can_mangle(name) {
if (reserved.indexOf(name) >= 0) return false;
if (options.only_cache) { if (options.only_cache) {
return cache.props.has(name); return cache.props.has(name);
} }
if (reserved.indexOf(name) >= 0) return false;
if (/^[0-9.]+$/.test(name)) return false; if (/^[0-9.]+$/.test(name)) return false;
return true; return true;
} }