Thanks for asking the question. I was also curious about the ! before the function. That was a great article - thanks Arian for pointing it out.
~Philip On Thu, Mar 29, 2012 at 9:05 AM, Dimitar Christoff <[email protected]>wrote: > On 29/03/2012 13:47, hamburger wrote: > >> thx Arian, >> thats a good hint. >> I have it. >> > > keep in mind that bundlers like jawr or minifiers may give you grief if > they are unaware of this pattern. in particular: > > !function() {}() > > !function() {}() > > is fine. > > but if it gets converted to: > !function() {}()!function() {}() > > it will cause an exception > > closure now puts the ; correctly but ... you get the idea. > > eg issues with twitter bootstrap that uses this pattern: > https://github.com/twitter/**bootstrap/issues/401<https://github.com/twitter/bootstrap/issues/401> > > https://github.com/twitter/**bootstrap/pull/2069<https://github.com/twitter/bootstrap/pull/2069> > > https://github.com/twitter/**bootstrap/issues/625<https://github.com/twitter/bootstrap/issues/625> > > etc etc. > > regards, > -- > Dimitar Christoff > > "JavaScript is to JAVA what hamster is to ham" > http://fragged.org/ | @D_mitar | > https://github.com/**DimitarChristoff<https://github.com/DimitarChristoff> > -- http://lonestarlightandsound.com/
