简单JS代码压缩器

2019-06-03 18:43:24于海丽

       return this._choiceElement.contains(this._caseSensitive?val:val.toLowerCase());
   }

   this.isSingleEyeElement = function(val) {
       return this._singleEyeElement.contains(this._caseSensitive?val:val.toLowerCase());
   }

   this.isNextElement = function(from,word){
       for(var i=from;i<word.length;i++){
           if(word[i]!=" "&&word[i]!="t"&&word[i]!="r"&&word[i]!="n"){                
               return this.isChoiceElement(word[i]);
           }
       }
       return false;
   }

   this.getSkipLength = function(val){    
       var count = 0;
       for(var i=0;i<val.length;i++){
           if(this._wordDelimiters.indexOf(val.charAt(i))>=0){
               count++;
           }
       }
       if(count>0){
           count=count-1;
       }
       return count;
   }

   this.getIdent=function(){
       var n = [];
       for(var i=0;i<this._tabNum;i++){
           n[n.length] = "t";
       }
       return n.join("");
   }
}

function doformat(o){
   var htmltxt = "";

   if (o == null){
       alert("domNode is null!");
       return;
   }

   var _codetxt = "";

   if(typeof(o)=="object"){
       switch(o.tagName){
           case "TEXTAREA":
           case "INPUT":