aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2015-03-16 10:53:31 +0200
committerMihai Bazon <mihai.bazon@gmail.com>2015-03-16 10:53:31 +0200
commit0c80d21e01f7f7f7ec76f80ed02e4935ca9d952a (patch)
tree288ed6ea80e0a1c0c9fbb9905c0dc0d17389361d
parent375c88245a89fecf4387d6bde732ee2f230aecc6 (diff)
downloadtracifyjs-0c80d21e01f7f7f7ec76f80ed02e4935ca9d952a.tar.gz
tracifyjs-0c80d21e01f7f7f7ec76f80ed02e4935ca9d952a.zip
Fix prop mangling
Even if not “defined”, do mangle if name exists in the cache.
-rw-r--r--lib/propmangle.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/propmangle.js b/lib/propmangle.js
index 41eeffe4..f79b4748 100644
--- a/lib/propmangle.js
+++ b/lib/propmangle.js
@@ -145,7 +145,8 @@ function mangle_properties(ast, options) {
}
function should_mangle(name) {
- return names_to_mangle.indexOf(name) >= 0;
+ return cache.props.has(name)
+ || names_to_mangle.indexOf(name) >= 0;
}
function add(name) {