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

Re: Web and rhino differences

Expand Messages
  • 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 1 of 7 , May 19, 2010
    • 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 2 of 7 , May 21, 2010
      • 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 3 of 7 , May 30, 2010
        • 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.