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

Re: [jslint] Re: Unexpected else after return

Expand Messages
  • Erik Eckhardt
    Douglas, You may not wish to use llvm.org as a resource for coding standards, as the same page suggests the use of early
    Message 1 of 9 , Feb 28, 2012
    • 0 Attachment
      Douglas,

      You may not wish to use llvm.org as a resource for coding standards, as the
      same page suggests the use of early
      exits<http://llvm.org/docs/CodingStandards.html#hl_earlyexit>
      .

      For example, I know you do not like constructions like the following
      (though I do):

      for (var k in obj) {
      ___if (!obj.hasOwnProperty) { break; }
      ___//rest of long loop;
      }

      On Tue, Feb 28, 2012 at 11:14 AM, douglascrockford <douglas@...>wrote:

      > **
      >
      >
      > --- In jslint_com@yahoogroups.com, Kirk Cerny <kirksemail@...> wrote:
      > >
      > > Thanks for supporting JsLint. I really enjoy using it.
      > >
      > > Is this a new rule?
      > > I get this error now.
      > > Can someone please explain the reason behind the rule?
      >
      > Please see http://llvm.org/docs/CodingStandards.html#hl_else_after_return
      >
      >
      >


      [Non-text portions of this message have been removed]
    • douglascrockford
      ... I adopted the ones that made sense.
      Message 2 of 9 , Feb 28, 2012
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, Erik Eckhardt <erik@...> wrote:

        > You may not wish to use llvm.org as a resource for coding standards, as the
        > same page suggests the use of early
        > exits<http://llvm.org/docs/CodingStandards.html#hl_earlyexit>
        > .

        I adopted the ones that made sense.
      • Martin Cooper
        ... Where can we find that list? It s important that we can know the rules up front, and not discover them only when JSLint complains. -- Martin Cooper
        Message 3 of 9 , Mar 3, 2012
        • 0 Attachment
          On Tue, Feb 28, 2012 at 6:15 PM, douglascrockford <douglas@...> wrote:
          > --- In jslint_com@yahoogroups.com, Erik Eckhardt <erik@...> wrote:
          >
          >> You may not wish to use llvm.org as a resource for coding standards, as the
          >> same page suggests the use of early
          >> exits<http://llvm.org/docs/CodingStandards.html#hl_earlyexit>
          >> .
          >
          > I adopted the ones that made sense.

          Where can we find that list? It's important that we can know the rules
          up front, and not discover them only when JSLint complains.

          --
          Martin Cooper


          > ------------------------------------
          >
          > Yahoo! Groups Links
          >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.