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

Re: Web and rhino differences

Expand Messages
  • santini.alberto
    The snippet: function foo(p1) { var a = p1, b; return a; } Regards, Alberto
    Message 1 of 7 , May 18 3:39 AM
    • 0 Attachment
      The snippet:

      function foo(p1) {
      var a = p1, b;
      return a;
      }

      Regards,
      Alberto
    • santini.alberto
      It seems there is a difference if I use, for instance, FireFox (3.6.3) on Windows XP: the web version catches correctly the two errors. In my first post I used
      Message 2 of 7 , May 19 3:43 AM
      • 0 Attachment
        It seems there is a difference if I use, for instance, FireFox (3.6.3) on Windows XP: the web version catches correctly the two errors.

        In my first post I used Firefox 3.6.3 on Ubuntu 10.04.

        Locally on Windows or Linux, using the rhino approach, I get "only" the error "Missing "use strict" statement.".

        The options are the same: good parts enabled.

        Any idea or suggestion?

        Regards,
        Alberto
      • Douglas Crockford
        ... It would seem that there is a bug in Rhino.
        Message 3 of 7 , May 19 6:22 AM
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, "santini.alberto" <albertosantini@...> wrote:
          >
          >
          > It seems there is a difference if I use, for instance, FireFox (3.6.3) on Windows XP: the web version catches correctly the two errors.
          >
          > In my first post I used Firefox 3.6.3 on Ubuntu 10.04.
          >
          > Locally on Windows or Linux, using the rhino approach, I get "only" the error "Missing "use strict" statement.".
          >
          > The options are the same: good parts enabled.
          >
          > Any idea or suggestion?


          It would seem that there is a bug in Rhino.
        • santini.alberto
          ... On Windows I used cscript executable and the output is equals to rhino one. Same bug? Possible but with low probability. Regards, Alberto
          Message 4 of 7 , May 19 6:43 AM
          • 0 Attachment
            --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
            >
            > It would seem that there is a bug in Rhino.
            >

            On Windows I used "cscript" executable and the output is equals to rhino one.

            Same bug? Possible but with low probability.

            Regards,
            Alberto
          • santini.alberto
            ... I jslinted the snippet with V8 [1]: it reports only use strict error. No idea because it doesn t report also unused variable error. Regards, Alberto
            Message 5 of 7 , May 21 1:52 PM
            • 0 Attachment
              --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
              >
              >
              > It would seem that there is a bug in Rhino.
              >

              I jslinted the snippet with V8 [1]: it reports only "use strict" error.

              No idea because it doesn't report also "unused variable" error.

              Regards,
              Alberto

              [1] http://groups.google.com/group/nodejs/t/aa30e1b6f4f6314f
            • santini.alberto
              ... I added in my rhino script the following code: data = JSLINT.data(); if (data.unused) { for (i = 0; i
              Message 6 of 7 , May 30 11:04 AM
              • 0 Attachment
                --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
                >
                > It would seem that there is a bug in Rhino.
                >

                I added in my rhino script the following code:

                data = JSLINT.data();
                if (data.unused) {
                for (i = 0; i < data.unused.length; i += 1) {
                print(filename + ':' + data.unused[i].line + ': ' +
                'Unused variable \'' + data.unused[i].name + '\'.');
                }
                }

                It is quite similar to the code you found in the report function.
                Now the unused variables are printed.

                I think the web version print the html created by the report function.
                This is the difference between rhino and web jslint.

                Maybe a call of the warning function would be better, adding an item in errors array, when an unused variable is detected.

                Another approach may be adding a warning array: JSLINT.warnings.

                Regards,
                Alberto
              Your message has been successfully submitted and would be delivered to recipients shortly.