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

SV: [jslint] Re: Bad HTML string?

Expand Messages
  • Merlin
    ... Using Widget Tester: Welcome to Yahoo! Widgets 4.5.2x10A50 on 02/03/12 13:52:08.937 getJSLint:Using today s JSLint file. MD5 sum:
    Message 1 of 6 , Feb 3, 2012
    View Source
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Jakob Kruse" <kruse@...> wrote:
      >
      > Ah yes. Thanks Harry.
      >
      > Obviously the error is partly mine. The "Bad HTML string" error seems to be caused by an internal JSLint error on an earlier run. If you check this piece of HTML first (web interface is fine), then check the JavaScript piece again, you should see the error:

      Using Widget Tester:

      Welcome to Yahoo! Widgets 4.5.2x10A50 on 02/03/12 13:52:08.937
      getJSLint:Using today's JSLint file. MD5 sum: 73152b10706369d0c7dbea86751e12c6
      Widget Tester 9.4.4
      JSLint by Douglas Crockford, Edition 2012-01-26.

      Filename: t.js
      ok <<< first run OK

      Filename: html.html
      Working
      Lint at line 7 character 22: indent has no properties << html.html file gives error

      Filename: t.js
      Working
      Lint at line 3 character 13: Bad HTML string <<< second run fails

      html.html:
      <html>
      <head>
      <script type="text/javascript">
      /*jslint sloppy: true, on: true */
      </script>
      </head>
      <body onselectstart="return false;">
      </body>
      </html>

      t.js:
      /*jslint sloppy: true */
      function quote(s) {
      return '"' + s + '"';
      }


      Using the web version at http://www.JSLint.com/

      html.html:
      Error:
      Problem at line 192 character 22: 'null' is not an object (evaluating 'indent.at')

      t.js:
      Error:
      Problem at line 3 character 13: Bad HTML string

      return '"' + s + '"';

      It appears that JSLint is retaining state from one run to the next.

      The web and Widget Tester versions both fail, but not quite in the same way.

      Harry.
    • Jakob Kruse
      ... In case of internal errors, yes. ... Actually, they fail in exactly the same way, but the error message given for this error by different JavaScript
      Message 2 of 6 , Feb 3, 2012
      View Source
      • 0 Attachment
        > It appears that JSLint is retaining state from one run to the next.

        In case of internal errors, yes.

        > The web and Widget Tester versions both fail, but not quite in the same way.

        Actually, they fail in exactly the same way, but the error message given for this error by different JavaScript runtimes differs. Try running the web validation in Chrome for instance, and you will get a third error message.

        /Jakob
      • Merlin
        ... Confirmed: In Chrome: Error: Problem at line 7 character 22: Cannot read property at of null Over to Douglas! Harry.
        Message 3 of 6 , Feb 3, 2012
        View Source
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, "Jakob Kruse" <kruse@...> wrote:
          > > It appears that JSLint is retaining state from one run to the next.
          > In case of internal errors, yes.
          > > The web and Widget Tester versions both fail, but not quite in the same way.

          > Actually, they fail in exactly the same way, but the error message given for this error by different JavaScript runtimes differs. Try running the web validation in Chrome for instance, and you will get a third error message.

          Confirmed:
          In Chrome:
          Error:
          Problem at line 7 character 22: Cannot read property 'at' of null

          Over to Douglas!

          Harry.
        • douglascrockford
          ... Thanks. Please try it now. And by the way, in case anyone has been reading this thread, function quote(s) { return + s + ; } is a dangerously
          Message 4 of 6 , Feb 3, 2012
          View Source
          • 0 Attachment
            --- In jslint_com@yahoogroups.com, "Merlin" <g7awz@...> wrote:
            >
            > --- In jslint_com@yahoogroups.com, "Jakob Kruse" <kruse@> wrote:
            > > > It appears that JSLint is retaining state from one run to the next.
            > > In case of internal errors, yes.
            > > > The web and Widget Tester versions both fail, but not quite in the same way.
            >
            > > Actually, they fail in exactly the same way, but the error message given for this error by different JavaScript runtimes differs. Try running the web validation in Chrome for instance, and you will get a third error message.
            >
            > Confirmed:
            > In Chrome:
            > Error:
            > Problem at line 7 character 22: Cannot read property 'at' of null


            Thanks. Please try it now.

            And by the way, in case anyone has been reading this thread,

            function quote(s) {
            return '"' + s + '"';
            }

            is a dangerously insecure function. It should be removing or entityifying all '"' and '\\' in s before concatenating.
          • Jakob Kruse
            Works, thanks! And yes, don’t ever use that function or anything like it. It was a bad example. /Jakob Fra: jslint_com@yahoogroups.com
            Message 5 of 6 , Feb 3, 2012
            View Source
            • 0 Attachment
              Works, thanks! And yes, don’t ever use that function or anything like it. It was a bad example.

              /Jakob

              Fra: jslint_com@yahoogroups.com [mailto:jslint_com@yahoogroups.com] På vegne af douglascrockford
              Sendt: 3. februar 2012 19:04
              Til: jslint_com@yahoogroups.com
              Emne: SV: [jslint] Re: Bad HTML string?

              --- In jslint_com@yahoogroups.com, "Merlin" <g7awz@...> wrote:
              >
              > --- In jslint_com@yahoogroups.com, "Jakob Kruse" <kruse@> wrote:
              > > > It appears that JSLint is retaining state from one run to the next.
              > > In case of internal errors, yes.
              > > > The web and Widget Tester versions both fail, but not quite in the same way.
              >
              > > Actually, they fail in exactly the same way, but the error message given for this error by different JavaScript runtimes differs. Try running the web validation in Chrome for instance, and you will get a third error message.
              >
              > Confirmed:
              > In Chrome:
              > Error:
              > Problem at line 7 character 22: Cannot read property 'at' of null

              Thanks. Please try it now.

              And by the way, in case anyone has been reading this thread,

              function quote(s) {
              return '"' + s + '"';
              }

              is a dangerously insecure function. It should be removing or entityifying all '"' and '\\' in s before concatenating.

              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.