Make reserved names take priority over the name cache
authorMihai Bazon <mihai.bazon@gmail.com>
Thu, 7 May 2015 12:01:16 +0000 (15:01 +0300)
committerMihai Bazon <mihai.bazon@gmail.com>
Thu, 7 May 2015 12:01:16 +0000 (15:01 +0300)
lib/propmangle.js

index 8f291d6..d3e582d 100644 (file)
@@ -140,10 +140,10 @@ function mangle_properties(ast, options) {
     // only function declarations after this line
 
     function can_mangle(name) {
+        if (reserved.indexOf(name) >= 0) return false;
         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;
     }