Packer 3.0 and isMSIE hacks

Written by on April 2nd, 2007 in Ajax News.

Dean Edwards has released Packer v3.0, one of the top utilities to squeeze your JavaScript like a lemon.

  • respects Microsoft conditional comments
  • new option to shrink variable and argument identifiers
  • removed the special chars feature
    (except the ;;; feature which people seem to like)
  • some bug fixes:
    • packer no longer closes spaces between the +/- operators so code like this is safe: c = a++ +b;
    • the throw"error"} bug that affected Safari (this is a Safari bug really but packer gets around it)
    • the __proto__ bug for Mozilla browsers (this only affected the online version of packer)
    • a minor parsing bug affecting the detection of regular expressions
  • simplified the user interface

Dean also had some fun sniffing browsers and came up with the short test:

JAVASCRIPT:

  1.  
  2. var isMSIE = /*@cc_on!@*/false;
  3.  

but then Sil came up with:

JAVASCRIPT:

  1.  
  2. var isMSIE//@cc_on=1
  3.  

Source: Ajaxian
Original Article: http://ajaxian.com/archives/packer-30-and-ismsie-hacks

Leave a Reply

You must be logged in to post a comment.



Site Navigation