JSDOC/CompressWhite.js
authorAlan Knowles <alan@akbkhome.com>
Wed, 14 Jul 2010 08:07:24 +0000 (16:07 +0800)
committerAlan Knowles <alan@akbkhome.com>
Wed, 14 Jul 2010 08:07:24 +0000 (16:07 +0800)
JSDOC/CompressWhite.js

index bc7ba9e..f50a175 100644 (file)
@@ -76,7 +76,7 @@ CompressWhite =  function (ts, packer)
                 // if next is not ';' -> make it so...
                 // although this var a=function(){},v,c; causes 
                 if (ts.lookTok(1).data != ';' && ts.lookTok(1).data != '}' && ts.lookTok(1,true).name == "NEWLINE") {
-                    ts.look(0).outData = ts.look(0).data+";";
+                    ts.look(1).outData = ts.look(1).data+";";
                 }
                 // restore.. 
                 ts.cursor = cu;
@@ -151,38 +151,7 @@ CompressWhite =  function (ts, packer)
             
             // any more??
             // a = function(....) { } 
-               print("1:" +ts.lookTok(1).toString());
-                 print("2:" +ts.lookTok(2).toString());
-            if (ts.lookTok(1).data == '=' &&  ts.lookTok(2).name == 'FUNCTION' ) {
-                // freeze time.. 
-                print("compress white : got a = function ");
-                var cu = ts.cursor;
-                ts.balance("(");
-                if (!ts.balance("(") ){
-                    ts.dump(cu-40, cu);
-                    print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>");
-                    ts.dump(cu, cu+40);
-                    
-                    throw "could not find end lbrace!!!";
-                }
-                if (!ts.balance("{") ){
-                    ts.dump(cu-40, cu);
-                    print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>");
-                    ts.dump(cu, cu+40);
-                    
-                    throw "could not find end lbrace!!!";
-                }
-                // if next is not ';' -> make it so...
-                print(ts.lookTok(1).toString());
-                print(ts.lookTok(1,true).toString());
-                if (ts.lookTok(1).data != ';' && ts.lookTok(1).data != '}' && ts.look(1,true).name=="NEWLINE") {
-                    ts.look(0).outData = ts.look(0).data +";";
-                }
-                // restore.. 
-                ts.cursor = cu;
-                continue;
-            }
-            
+          
         }