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:
-
-
var isMSIE = /*@cc_on!@*/false;
-
but then Sil came up with:
JAVASCRIPT:
-
-
var isMSIE//@cc_on=1
-
Source: Ajaxian
Original Article: http://ajaxian.com/archives/packer-30-and-ismsie-hacks