Kean and especially Michael, Thank you for sharing this very useful knowledge bit ! This must be the most insightful thread in a while :)
Alexandre On Wed, Dec 31, 2008 at 8:49 AM, Kean <shenan...@gmail.com> wrote: > > Alexandre, > > Another word of caution. Do choose your labels carefully. Avoid > keywords. > Adding quotes to keyword labels ensure compatibility with YUI > compressor. > > var a = { > // new without quotes produce error in ie > "new": function() { > alert("new"); > }, > // class without quotes produce error in ie > "class": function() { > alert("class"); > }, > // YUI compressor won't compress if you have no quotes on keywords > float: function() { > alert("float"); > }, > int: function(){ > alert("int"); > } > } > > a.new(); // still fails in ie > a.class(); // still fails in ie > a.float(); > a.int(); >