JSDOC/Packer.js
[gnome.introspection-doc-generator] / JSDOC / Packer.js
index 678152f..1bdde2e 100644 (file)
@@ -232,6 +232,9 @@ Packer.prototype = {
         if (this.debugTarget) {
             File.write(this.debugTarget, "");
         }
+        if (this.debugTranslateTarget) {
+            File.write(this.debugTarget, "");
+        }
         
         for(var i=0; i < this.files.length; i++)  {
             var file = this.files[i];
@@ -269,7 +272,7 @@ Packer.prototype = {
                 }
                 
             }
-            
+             
             print("COMPRESSING ");
             //var codeComp = pack(str, 10, 0, 0);
             if (File.exists(minfile)) {
@@ -277,13 +280,15 @@ Packer.prototype = {
             }
             var str = File.read(file);
             var str = this.pack(str, file, minfile);
-            if (str.length) {
-                File.write(minfile, str);
-            }
-            
              
           
-        }  
+        }
+        
+        
+        
+        // if we are translating, write the translations strings at the top
+        // of the file..
+        
         if (this.translateJSON) {
             
                
@@ -294,9 +299,7 @@ Packer.prototype = {
             } else {
                 this.out += out;
             }
-            
-            
-            
+             
             File.write(this.translateJSON, "");
             for(var i=0; i < this.files.length; i++)  {
                 var file = this.files[i];
@@ -414,10 +417,16 @@ Packer.prototype = {
         print(sp.warnings.join("\n"));
         
         
+        
         var out = CompressWhite(new TokenStream(toks), this, this.keepWhite); // do not kill whitespace..
         
         
         this.timerPrint("Compressed");
+        
+         if (out.length) {
+            File.write(minfile, out);
+        }
+        
         return out;