Fix prop mangling
authorMihai Bazon <mihai.bazon@gmail.com>
Mon, 16 Mar 2015 08:53:31 +0000 (10:53 +0200)
committerMihai Bazon <mihai.bazon@gmail.com>
Mon, 16 Mar 2015 08:53:31 +0000 (10:53 +0200)
Even if not “defined”, do mangle if name exists in the cache.

lib/propmangle.js

index 41eeffe..f79b474 100644 (file)
@@ -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) {