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

256Re: JSLint for checking javascript for Firefox extensions

Expand Messages
  • Douglas Crockford
    Oct 3, 2008
      --- In jslint_com@yahoogroups.com, "saturn_jct" <turner@...> wrote:
      > After tracking down a bug in of the HTML Validator Firefox
      > extension, I decided to try out JSLint on some of the code in it. It
      > doesn't work because of some things that I think are Javascript
      > extensions usable only by Firefox extensions.
      > The first problem I ran into is the use of "const", which isn't
      > recognized by JSLint.
      > The other problem was the use of "window.arguments". JSLint considers
      > "arguments" to be a reserved word. Try as I might, I couldn't find a
      > reference anywhere that listed arguments as a current or possible
      > future reserved word. I did find out that "window.arguments" is an
      > additional property created when a window is created using
      > window.OpenDialog, which appears to be part of the Gecko DOM. See
      > http://developer.mozilla.org/en/DOM/window.openDialog
      > Now beyond these two problems, JSLint was showing lots of questionable
      > things in the Javascript of the extension.
      > Where I'm going with this is that I think it would be of significant
      > use to people to be able to use JSLint on the code for their Firefox
      > extensions. There would be the problem of sorting out what extensions
      > and modifications are available when programming for Firefox Extensions.

      Early on JSLint had support for some of JScript's deviations. I
      decided to remove that because we are better off sticking to the
      portable standard. I think that is still good advice.

      Just because Firefox plays fast and loose with the standard doesn't
      mean that we should.

      JSLint reserves arguments to prevent a number of bad actions that
      happen from attempting to modify arguments.

      Any property stored in the global object (aka window) is a global
    • Show all 4 messages in this topic