简单JS代码压缩器

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

               _hash.add((_key[i]+"").toLowerCase());
           }

       }
       return _hash;
   }

   //获得需要转换的代码
   this._codetxt        = code;

   if(typeof(syntax)=="undefined"){
       syntax = "";
   }

   this._deleteComment = false;
   //是否大小写敏感
   this._caseSensitive = true;
   //可以后面加块语句的关键字
   this._blockElement  = this.str2hashtable("switch,if,while,try,finally");
   //是函数申明
   this._function      = this.str2hashtable("function");
   //本行括号内分号不做换行
   this._isFor            = "for";

   this._choiceElement = this.str2hashtable("else,catch");

   this._beginBlock    = "{";
   this._endBlock      = "}";

   this._singleEyeElement = this.str2hashtable("var,new,return,else,delete,in,case");
   //得到分割字符
   this._wordDelimiters= "  ,.?!;:/<>(){}[]"'rnt=+-|*%@#$^&";
   //引用字符
   this._quotation     = this.str2hashtable("",'");
   //行注释字符
   this._lineComment   = "//";
   //转义字符
   this._escape        = "";
   //多行引用开始
   this._commentOn        = "/*";
   //多行引用结束
   this._commentOff    = "*/";
   //行结束词
   this._rowEnd        = ";";

   this._in            = "in";


   this.isCompress        = false;
   this.style            = 0;

   this._tabNum        = 0;


   this.format = function() {