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

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

Expand Messages
  • Satyam
    I was about to reply that I don t use IE but Firefox but then I realized I m running this script in my IDE which probably uses MS-Windows default interpreter.
    Message 1 of 16 , Jun 9, 2011
    • 0 Attachment
      I was about to reply that I don't use IE but Firefox but then I realized
      I'm running this script in my IDE which probably uses MS-Windows default
      interpreter.

      However, I've been using JSLint in this IDE for a long time and didn't
      have any offset so either the fix to string split has been removed
      recently or this one is a new issue.


      El 09/06/2011 19:40, Douglas Crockford escribió:
      >
      > --- In jslint_com@yahoogroups.com
      > <mailto:jslint_com%40yahoogroups.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.
      >
      > You did not mention which browser you are using, so I must assume it
      > is IE. There is a bug in IE's string.split method that causes it to
      > lose track of blank lines.
      >
      > I used to work around Microsoft's blunders, which had the effect of
      > making Microsoft's implementations look better than they were, and
      > allowed Microsoft to go decades without fixing obvious bugs.
      >
      > That strategy clearly didn't work.
      >
      > So I refuse to do that anymore. I will no longer work around
      > Microsoft's bugs. So my advice to you is to not use any version of IE
      > until Microsoft fixes this.
      >
      >
      > ------------------------------------------------------------------------
      >
      > No virus found in this message.
      > Checked by AVG - www.avg.com <http://www.avg.com>
      > Version: 10.0.1382 / Virus Database: 1513/3690 - Release Date: 06/09/11
      >


      [Non-text portions of this message have been removed]
    • Jakob Kruse
      I might add that my original motivation for using Jslint was to help make javascript run in IE. It still is, to some degree, although general code quality is
      Message 2 of 16 , Jun 9, 2011
      • 0 Attachment
        I might add that my original motivation for using Jslint was to help make javascript run in IE. It still is, to some degree, although general code quality is now a greater motivation. I fully understand the resentment of supporting a broken browser, I feel the same way in my work, but having a tool like Jslint not run (correctly) in any major browser, especially one as badly in need of such a tool as IE is, seems wrong.

        /Jakob

        On 09/06/2011, at 19.55, Erik Eckhardt <erik@...> wrote:

        > I wish everyone had done this kind of thing about 10 years ago. Then we
        > would have had some progress.
        >
        > Doing it now just seems counterproductive. Microsoft is not going to take
        > notice of jslint having an error and fix it, so effectively this just blows
        > up everyone using IE. Do you know what % of your users are on IE?
        >
        > I use Firefox for the most part but know that there is still a strong IE
        > following, especially now that Microsoft is releasing versions more often.
        > IE9 is starting to take back some of its share from Firefox.
        >
        > On Thu, Jun 9, 2011 at 10:40 AM, Douglas Crockford <douglas@...>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.
        >>
        >> You did not mention which browser you are using, so I must assume it is IE.
        >> There is a bug in IE's string.split method that causes it to lose track of
        >> blank lines.
        >>
        >> I used to work around Microsoft's blunders, which had the effect of making
        >> Microsoft's implementations look better than they were, and allowed
        >> Microsoft to go decades without fixing obvious bugs.
        >>
        >> That strategy clearly didn't work.
        >>
        >> So I refuse to do that anymore. I will no longer work around Microsoft's
        >> bugs. So my advice to you is to not use any version of IE until Microsoft
        >> fixes this.
        >>
        >>
        >>
        >
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
      • Douglas Crockford
        ... You are right. I restored the IE workaround. If anyone from Microsoft is watching, can you please lean on the JScript guys to get string.split(/rx/) fixed?
        Message 3 of 16 , Jun 9, 2011
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, Jakob Kruse <kruse@...> wrote:
          >
          > I might add that my original motivation for using Jslint was to help make javascript run in IE. It still is, to some degree, although general code quality is now a greater motivation. I fully understand the resentment of supporting a broken browser, I feel the same way in my work, but having a tool like Jslint not run (correctly) in any major browser, especially one as badly in need of such a tool as IE is, seems wrong.


          You are right. I restored the IE workaround.

          If anyone from Microsoft is watching, can you please lean on the JScript guys to get string.split(/rx/) fixed?
        • Rob Richardson
          Thank you. This was a very good choice. Rob ... From: jslint_com@yahoogroups.com [mailto:jslint_com@yahoogroups.com] On Behalf Of Douglas Crockford Sent:
          Message 4 of 16 , Jun 9, 2011
          • 0 Attachment
            Thank you. This was a very good choice.

            Rob


            -----Original Message-----
            From: jslint_com@yahoogroups.com [mailto:jslint_com@yahoogroups.com] On
            Behalf Of Douglas Crockford
            Sent: Thursday, June 09, 2011 1:26 PM
            To: jslint_com@yahoogroups.com
            Subject: [jslint] Re: Lines numbers in error report seem to be off in latest
            version

            --- In jslint_com@yahoogroups.com, Jakob Kruse <kruse@...> wrote:
            >
            > I might add that my original motivation for using Jslint was to help make
            javascript run in IE. It still is, to some degree, although general code
            quality is now a greater motivation. I fully understand the resentment of
            supporting a broken browser, I feel the same way in my work, but having a
            tool like Jslint not run (correctly) in any major browser, especially one as
            badly in need of such a tool as IE is, seems wrong.


            You are right. I restored the IE workaround.

            If anyone from Microsoft is watching, can you please lean on the JScript
            guys to get string.split(/rx/) fixed?
          • 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 5 of 16 , Mar 1, 2012
            • 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 6 of 16 , Mar 1, 2012
              • 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 7 of 16 , Mar 29, 2012
                • 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 8 of 16 , Mar 29, 2012
                  • 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 9 of 16 , Mar 29, 2012
                    • 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 10 of 16 , Mar 30, 2012
                      • 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 11 of 16 , Apr 4, 2012
                        • 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 12 of 16 , Apr 4, 2012
                          • 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 13 of 16 , Apr 4, 2012
                            • 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.