Better process_for_angular before other statement reductions. #395
authorMihai Bazon <mihai@bazon.net>
Wed, 8 Jan 2014 09:39:24 +0000 (11:39 +0200)
committerMihai Bazon <mihai@bazon.net>
Wed, 8 Jan 2014 09:39:24 +0000 (11:39 +0200)
lib/compress.js

index 488818c..7df6693 100644 (file)
@@ -199,6 +199,9 @@ merge(Compressor.prototype, {
         var CHANGED;
         do {
             CHANGED = false;
+            if (compressor.option("angular")) {
+                statements = process_for_angular(statements);
+            }
             statements = eliminate_spurious_blocks(statements);
             if (compressor.option("dead_code")) {
                 statements = eliminate_dead_code(statements, compressor);
@@ -212,9 +215,6 @@ merge(Compressor.prototype, {
             if (compressor.option("join_vars")) {
                 statements = join_consecutive_vars(statements, compressor);
             }
-            if (compressor.option("angular")) {
-                statements = process_for_angular(statements);
-            }
         } while (CHANGED);
 
         if (compressor.option("negate_iife")) {