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

Re: Lines numbers in error report seem to be off in latest version

Expand Messages
  • mariana.schiff
    ... The line counter is off again for me. I m using JSLint as part of my pre-build process, and as an external tool in my development environment. In both
    Message 1 of 16 , Mar 1, 2012
    View Source
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, Satyam <satyam@...> wrote:
      >
      > It seems the line counter is not counting the blank lines, at least
      > that's what it seems in the first few lines when the code causing the
      > error seemed obvious, later on, I could not pinpoint what's setting it
      > off, if anything else is.
      >

      The line counter is off again for me.

      I'm using JSLint as part of my pre-build process, and as an external tool in my development environment. In both cases, I'm using the WSH ReadAll method to read in the JavaScript file.

      I've tried changing the line endings of my source files, but WSH.ReadAll must be changing them all back, because the JSLint line counter gets off by one for every blank line in the source, regardless of line ending character(s).

      I noticed the IE workaround was backed in on Jun 09, 2011, and removed again on Feb 20, 2012. That's when my line counts broke. Is there any hope that this workaround will be put back in? Do I need to use WSH.ReadLine in my script and concatenate the lines before calling JSLINT? I'd expect this change broke anybody using JSLint with WSH.
    • douglascrockford
      ... This is due to a bug in JScript. The bug has been there for well over a decade. I have adopted a pledge to no longer work around Microsoft s bugs. The
      Message 2 of 16 , Mar 1, 2012
      View Source
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "mariana.schiff" <Mariana.Schiff@...> wrote:
        >
        >
        >
        > --- In jslint_com@yahoogroups.com, Satyam <satyam@> wrote:
        > >
        > > It seems the line counter is not counting the blank lines, at least
        > > that's what it seems in the first few lines when the code causing the
        > > error seemed obvious, later on, I could not pinpoint what's setting it
        > > off, if anything else is.
        > >
        >
        > The line counter is off again for me.
        >
        > I'm using JSLint as part of my pre-build process, and as an external tool in my development environment. In both cases, I'm using the WSH ReadAll method to read in the JavaScript file.
        >
        > I've tried changing the line endings of my source files, but WSH.ReadAll must be changing them all back, because the JSLint line counter gets off by one for every blank line in the source, regardless of line ending character(s).
        >
        > I noticed the IE workaround was backed in on Jun 09, 2011, and removed again on Feb 20, 2012. That's when my line counts broke. Is there any hope that this workaround will be put back in? Do I need to use WSH.ReadLine in my script and concatenate the lines before calling JSLINT? I'd expect this change broke anybody using JSLint with WSH.



        This is due to a bug in JScript. The bug has been there for well over a decade.

        I have adopted a pledge to no longer work around Microsoft's bugs. The ultimate result of those workarounds is that Microsoft is under no pressure to ever fix them.

        So until Microsoft acts, I recommend that you not use JScript or WSH. Nodejs is an excellent alternative.
      • cse_html_validator
        ... Well this is unfortunate. I updated am am getting reports of line # s being off. I d like to keep using JSLint, but I m not sure if I can continue to do so
        Message 3 of 16 , Mar 29, 2012
        View Source
        • 0 Attachment
          > This is due to a bug in JScript. The bug has been there for well over a decade.
          >
          > I have adopted a pledge to no longer work around Microsoft's bugs. The ultimate result of those workarounds is that Microsoft is under no pressure to ever fix them.
          >
          > So until Microsoft acts, I recommend that you not use JScript or WSH. Nodejs is an excellent alternative.

          Well this is unfortunate. I updated am am getting reports of line #'s being off.

          I'd like to keep using JSLint, but I'm not sure if I can continue to do so it doesn't generate correct line numbers, regardless of the source of the problem.

          What is the latest version that I can get that still generates correct line numbers with WSH?
        • cse_html_validator
          ... Or can the fix be put back in? I think that having to use the fix is unfortunate, but practicality would be on the side of working around MS bugs that are
          Message 4 of 16 , Mar 29, 2012
          View Source
          • 0 Attachment
            --- In jslint_com@yahoogroups.com, "cse_html_validator" <alhome@...> wrote:
            > What is the latest version that I can get that still generates correct line numbers with WSH?

            Or can the fix be put back in?

            I think that having to use the fix is unfortunate, but practicality would be on the side of working around MS bugs that are unlikely to get fixed.
          • Sean Kelly
            You might look at node.js This has become my go to solution for running JavaScript locally. While it is designed to run really awesome web servers, and
            Message 5 of 16 , Mar 29, 2012
            View Source
            • 0 Attachment
              You might look at node.js This has become my "go to" solution for running
              JavaScript locally. While it is designed to run really awesome web servers,
              and indeed it does. It also has locally run tools like coffee-script, less,
              uglifyjs and jslint! Not only that but unlike WSH, it works on Windows, Mac
              and Linux. It also has a built in package manager so once you install node
              and add it to your path, you can install jslint with the following command.

              npm install jslint -g

              then to run jslint from the command line

              jslint mycode.js

              SeanK


              On Thu, Mar 29, 2012 at 11:05 AM, cse_html_validator <alhome@...>wrote:

              > **
              >
              >
              > > This is due to a bug in JScript. The bug has been there for well over a
              > decade.
              > >
              > > I have adopted a pledge to no longer work around Microsoft's bugs. The
              > ultimate result of those workarounds is that Microsoft is under no pressure
              > to ever fix them.
              > >
              > > So until Microsoft acts, I recommend that you not use JScript or WSH.
              > Nodejs is an excellent alternative.
              >
              > Well this is unfortunate. I updated am am getting reports of line #'s
              > being off.
              >
              > I'd like to keep using JSLint, but I'm not sure if I can continue to do so
              > it doesn't generate correct line numbers, regardless of the source of the
              > problem.
              >
              > What is the latest version that I can get that still generates correct
              > line numbers with WSH?
              >
              >
              >


              [Non-text portions of this message have been removed]
            • cse_html_validator
              ... Thanks. I looked at it briefly, but I need an equivalent replacement for the code I posted in Is there a node.js equivalent for wsh.js? . If I can get
              Message 6 of 16 , Mar 30, 2012
              View Source
              • 0 Attachment
                --- In jslint_com@yahoogroups.com, Sean Kelly <home@...> wrote:
                >
                > You might look at node.js This has become my "go to" solution for running
                > JavaScript locally.

                Thanks. I looked at it briefly, but I need an equivalent replacement for the code I posted in "Is there a node.js equivalent for wsh.js?". If I can get that, then I may switch, especially if it's faster or lighter weight than using WSH (which I suspect it is).
              • mariana.schiff
                I modified the wsh.js code to, basically, put the fix back in. Replace the line source = file.ReadAll(); with the following: source = File.ReadAll()
                Message 7 of 16 , Apr 4 7:41 AM
                View Source
                • 0 Attachment
                  I modified the wsh.js code to, basically, put "the fix" back in.

                  Replace the line

                  source = file.ReadAll();

                  with the following:

                  source = File.ReadAll()
                  .replace(/\r\n/g, '\n')
                  .replace(/\r/g, '\n')
                  .split('\n');

                  I hope it makes sense. It works well for us.

                  --- In jslint_com@yahoogroups.com, "cse_html_validator" <alhome@...> wrote:
                  >
                  >
                  >
                  > --- In jslint_com@yahoogroups.com, Sean Kelly <home@> wrote:
                  > >
                  > > You might look at node.js This has become my "go to" solution for running
                  > > JavaScript locally.
                  >
                  > Thanks. I looked at it briefly, but I need an equivalent replacement for the code I posted in "Is there a node.js equivalent for wsh.js?". If I can get that, then I may switch, especially if it's faster or lighter weight than using WSH (which I suspect it is).
                  >
                • Sean Kelly
                  OK, I updated the page, let me know if it looks right. On Wed, Apr 4, 2012 at 7:41 AM, mariana.schiff ... [Non-text portions of this message have been removed]
                  Message 8 of 16 , Apr 4 10:43 AM
                  View Source
                  • 0 Attachment
                    OK, I updated the page, let me know if it looks right.

                    On Wed, Apr 4, 2012 at 7:41 AM, mariana.schiff
                    <Mariana.Schiff@...>wrote:

                    > **
                    >
                    >
                    > I modified the wsh.js code to, basically, put "the fix" back in.
                    >
                    > Replace the line
                    >
                    > source = file.ReadAll();
                    >
                    > with the following:
                    >
                    > source = File.ReadAll()
                    > .replace(/\r\n/g, '\n')
                    > .replace(/\r/g, '\n')
                    > .split('\n');
                    >
                    > I hope it makes sense. It works well for us.
                    >
                    > --- In jslint_com@yahoogroups.com, "cse_html_validator" <alhome@...>
                    > wrote:
                    > >
                    > >
                    > >
                    > > --- In jslint_com@yahoogroups.com, Sean Kelly <home@> wrote:
                    > > >
                    > > > You might look at node.js This has become my "go to" solution for
                    > running
                    > > > JavaScript locally.
                    > >
                    > > Thanks. I looked at it briefly, but I need an equivalent replacement for
                    > the code I posted in "Is there a node.js equivalent for wsh.js?". If I can
                    > get that, then I may switch, especially if it's faster or lighter weight
                    > than using WSH (which I suspect it is).
                    > >
                    >
                    >
                    >


                    [Non-text portions of this message have been removed]
                  • mariana.schiff
                    Looks great (I had misspelled file ). Thanks for the credit, Mariana
                    Message 9 of 16 , Apr 4 10:51 AM
                    View Source
                    • 0 Attachment
                      Looks great (I had misspelled 'file').

                      Thanks for the credit,

                      Mariana

                      --- In jslint_com@yahoogroups.com, Sean Kelly <home@...> wrote:
                      >
                      > OK, I updated the page, let me know if it looks right.
                      >
                      > On Wed, Apr 4, 2012 at 7:41 AM, mariana.schiff
                      > <Mariana.Schiff@...>wrote:
                      >
                      > > **
                      > >
                      > >
                      > > I modified the wsh.js code to, basically, put "the fix" back in.
                      > >
                      > > Replace the line
                      > >
                      > > source = file.ReadAll();
                      > >
                      > > with the following:
                      > >
                      > > source = File.ReadAll()
                      > > .replace(/\r\n/g, '\n')
                      > > .replace(/\r/g, '\n')
                      > > .split('\n');
                      > >
                      > > I hope it makes sense. It works well for us.
                      > >
                      > > --- In jslint_com@yahoogroups.com, "cse_html_validator" <alhome@>
                      > > wrote:
                      > > >
                      > > >
                      > > >
                      > > > --- In jslint_com@yahoogroups.com, Sean Kelly <home@> wrote:
                      > > > >
                      > > > > You might look at node.js This has become my "go to" solution for
                      > > running
                      > > > > JavaScript locally.
                      > > >
                      > > > Thanks. I looked at it briefly, but I need an equivalent replacement for
                      > > the code I posted in "Is there a node.js equivalent for wsh.js?". If I can
                      > > get that, then I may switch, especially if it's faster or lighter weight
                      > > than using WSH (which I suspect it is).
                      > > >
                      > >
                      > >
                      > >
                      >
                      >
                      > [Non-text portions of this message have been removed]
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.