]> source.dussan.org Git - jquery.git/commitdiff
A small fix that makes the Packer compressor about 10% more efficient.
authorJohn Resig <jeresig@gmail.com>
Sun, 25 Feb 2007 07:11:59 +0000 (07:11 +0000)
committerJohn Resig <jeresig@gmail.com>
Sun, 25 Feb 2007 07:11:59 +0000 (07:11 +0000)
build/js/pack.js

index 56bfdd1a2ef5cf56df44133eac9a0466c71e49c2..2c13dfb26565ed7b1471274cb79269dc589fd3bd 100644 (file)
@@ -110,7 +110,7 @@ function pack(_script, _encoding, _fastDecode, _specialChars) {
         var $parser = new ParseMaster;
         var $encode = _getEncoder(_encoding);
         // for high-ascii, don't encode single character low-ascii
-        var $regexp = (_encoding > 62) ? /\w\w+/ : /\w+/;
+        var $regexp = (_encoding > 62) ? /\w\w+/ : /(\(\)|\){|var |return |&&|==|typeof |function\(?|if\(|for\(|while\(|[a-zA-Z0-9]+|\)}|\[\d\])/;
         // build the word list
         $keywords = _analyze($script, _globalize($regexp), $encode);
         var $encoded = $keywords.$encoded;