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

errors and warning

Expand Messages
  • sharkfx2002
    Hello, I m new to JSLint, and did not have the time to examine the sources and group messages to a maximum extent; however, I have a question about warnings
    Message 1 of 3 , Mar 9, 2011
    • 0 Attachment
      Hello,

      I'm new to JSLint, and did not have the time to examine the sources and group messages to a maximum extent; however, I have a question about warnings and errors.

      I am trying to run JSLint on a very simple, erroneous code :

      function fun(x)
      {
      return x+1);
      }

      There are a lot of messages, but I am a little confused. For instance, I get

      Problem at line 3 character 11: Expected ';' and instead saw ')'

      This is correct, but it comes out through a call to "warning(m, t, a, b, c, d)"; shouldn't this be an error, not a warning ?

      Secondly, JSLint stops with the following message :

      Problem at line 3 character 11: Stopping. (75% scanned).

      The "passfail" is set to false, and I found out it only affects how the warnings, not errors are processed (it actually stops after the first "warning").

      So, I was hoping someone could enlighten me on the subject of warning vs. errors and their meaning.

      Are warning really errors ? Given the fact that "passfail" affects the behavior of "warning(m, t, a, b, c, d)", one can assume so.

      If yes, what are messages passed through "error(m, t, a, b, c, d)" ? Given the above conclusion about warnings, these would be unrecoverable errors.

      And how to make it go through the entire file regardless of the number of errors, if this is possible ?

      Thanks,
      Stefan.
    • Douglas Crockford
      ... You are not looking at a recent version. I recommend that you go to Github and get the latest. JSLint produces warnings. In most cases, after giving a
      Message 2 of 3 , Mar 10, 2011
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "sharkfx2002" <sharkfx2002@...> wrote:
        > I'm new to JSLint, and did not have the time to examine the sources and group messages to a maximum extent; however, I have a question about warnings and errors.


        You are not looking at a recent version. I recommend that you go to Github and get the latest.

        JSLint produces warnings. In most cases, after giving a warning, it will continue parsing. However, in some cases there is an increased likelihood that further warnings will be nonsense. In those cases it will stop.

        When it stops, that doesn't mean the last warning was more heinous than the others. It is just that JSLint is not confident that it can recover adequately.

        So fix your code and move on.
      • sharkfx2002
        Thanks for the reply. I will take a look at the latest version. From your message I understand that the terms warning and error do not have the same
        Message 3 of 3 , Mar 10, 2011
        • 0 Attachment
          Thanks for the reply. I will take a look at the latest version.

          From your message I understand that the terms "warning" and "error" do not have the same meaning as those used by a usual code compiler, because JSLint is not one.

          Am I correct ?

          Stefan.

          --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
          >
          > --- In jslint_com@yahoogroups.com, "sharkfx2002" <sharkfx2002@> wrote:
          > > I'm new to JSLint, and did not have the time to examine the sources and group messages to a maximum extent; however, I have a question about warnings and errors.
          >
          >
          > You are not looking at a recent version. I recommend that you go to Github and get the latest.
          >
          > JSLint produces warnings. In most cases, after giving a warning, it will continue parsing. However, in some cases there is an increased likelihood that further warnings will be nonsense. In those cases it will stop.
          >
          > When it stops, that doesn't mean the last warning was more heinous than the others. It is just that JSLint is not confident that it can recover adequately.
          >
          > So fix your code and move on.
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.