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

1722Re: [jslint] Error Suggestion

Expand Messages
  • Luke Page
    Jan 4, 2011
    • 0 Attachment
      yes and I don't think that should be stopped, but would it make sense to
      have

      $('#id').appendChild
      (div).css
      ('background-color', 'blue').show();

      I think that would always be a mistake?

      On 4 January 2011 18:37, Erik Eckhardt <erik@...> wrote:

      > In popular javascript libraries like jQuery that use chaining, line breaks
      > are common:
      >
      > $('#id').appendChild(div)
      > ___.css('background-color', 'blue')
      > ___.show();
      >
      > On Tue, Jan 4, 2011 at 5:50 AM, Luke Page <luke.a.page@...> wrote:
      >
      > >
      > >
      > > Can I suggest there should not be allowed to be a line break between a
      > > function and invoking it?
      > >
      > > I had something like the following code
      > >
      > > var a = b && (c || d)
      > > (e || f).push(g);
      > >
      > > where I had mistakenly missed a semi-colon and it was not picked up by
      > > JSLint.
      > >
      > > it causes an error because the result of "b && (c || d)" is a boolean and
      > > it
      > > is being run as a function.
      > >
      > > Would it ever be valid (or good practice) to have a newline before a
      > > function execution or is there some other way to pick this up in JSLint?
      > >
      > > [Non-text portions of this message have been removed]
      > >
      > >
      > >
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >


      [Non-text portions of this message have been removed]
    • Show all 6 messages in this topic