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

Re: Web and rhino differences

Expand Messages
  • santini.alberto
    ... I added in my rhino script the following code: data = JSLINT.data(); if (data.unused) { for (i = 0; i
    Message 1 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.