Hacker News new | comments | show | ask | jobs | submit login

For point 3, it might be worthwhile understanding what the ECMA standard says about automatic semi-colon insertion. It won't happen for the following:

  a = b
This becomes:

  a = b;
and NOT:

  a = b++;
There are other, odd gotcha's, but this is the one being discussed.

I believe the issue with the bang (!) operator is that it's being considered as a binding de-reference of function objects. See here: https://mail.mozilla.org/pipermail/es-discuss/2010-July/0114...

Therefore, the problem with the code would be that an automatic semi-colon would not be inserted and the code, which is currently:

  !isActive && $parent.toggleClass('open')
Would become:

  clearMenus()!isActive && $parent.toggleClass('open');
Instead of:

  !isActive && $parent.toggleClass('open');
That was my understanding, at any rate.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact