Loading ...
Sorry, an error occurred while loading the content.

10Re: [jslint] else

Expand Messages
  • Jacob Davenport
    Mar 20 10:22 AM
    • 0 Attachment
      --- Douglas Crockford wrote:
      > This isn't Perl. JavaScript has a dangerous semicolon
      > insertion mechanism. More rigor is demanded.

      It certainly isn't Perl. I'd argue it's much easier to write bad code
      in Perl than JavaScript, but at least it doesn't insert semicolons for
      you. You've made that point many times.

      Do any browsers actually insert a semicolon after an unbrace carriage
      return? I don't think I'm being unsafe with breaking the unbrace and
      else statements with a carriage return. Doing so has the advantage
      that the "else" is lined up with the "if" statement, makes the code
      more readable, and the blocks more defined.

      If unbrace-return-else is actually dangerous, about which I'd like you
      to convince me, perhaps we can change jslint to catch it. If it's not
      dangerous, there's no need to change anything.
    • Show all 3 messages in this topic