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

Re: [jslint] Re: Problems

Expand Messages
  • Arthur Blake
    ... Sometimes I JSLint code that I didn t author, but rather inherited, and it s nice to have all the warnings at once so I can fix them all in one sweep
    Message 1 of 6 , Jun 4, 2009
    • 0 Attachment
      > >The 50 warnings limit is really too small.
      > If you fixed your code, the number of warnings would drop to zero.

      Sometimes I JSLint code that I didn't author, but rather inherited,
      and it's nice to have all the warnings at once so I can fix them all
      in one sweep without having to run JSLint multiple times (especially
      when the number of warnings is in the hundreds or thousands which is
      typical with code that have never been JSLinted before)
    • benxwhite
      In some browsers the catch block has it s own scope, in others it does not... you could try this to prove... try { var x = new ActiveXObject( throw.error ); }
      Message 2 of 6 , Jun 4, 2009
      • 0 Attachment
        In some browsers the catch block has it's own scope, in others it does not...

        you could try this to prove...

        try {
        var x = new ActiveXObject('throw.error');
        } catch (e) {
        document.write(typeof e + '<br/>');
        }
        document.write(typeof e + '<br/>');


        --- In jslint_com@yahoogroups.com, Jean-Charles Meyrignac <jcmeyrignac@...> wrote:
        >
        > First, could JsLint displays the number of errors and warnings, and can you
        > add a way to configure the number of warnings ?
        > The 50 warnings limit is really too small.
        >
        >
        > My first problem is a mis-detection about an unused variable:
        >
        > PageBot.prototype.locateElementByAugureExport = function(identifier,
        > > inDocument, inWindow)
        > > {
        > > var reg=new RegExp("[;]+", "g");
        > > var *arguments*=identifier.split(reg);
        > > if (*arguments*.length < 2)
        > > {
        > > throw new SeleniumError("Unknown locator: " + identifier);
        > > }
        > > return LocateAugureExport(inDocument.body, *arguments*);
        > > };
        > >
        > >
        > > JsLint says:
        >
        > > 1 "locateElementByAugureExport"(identifier, inDocument, inWindow)
        > >> *Unused arguments*
        > >>
        > >
        >
        > The second problem is when doing consecutive catch():
        >
        > function createXMLHttpRequest()
        > > {
        > > try { return new XMLHttpRequest();} *catch(e)*{}
        > > try { return new ActiveXObject("Msxml2.XMLHTTP");} *catch(e)*{}
        > > try { return new ActiveXObject("Microsoft.XMLHTTP");} *catch(e)*{}
        > > try { return new ActiveXObject('Msxml2.XMLHTTP.4.0');} *catch(e)*{}
        > >
        > > alert("Your browser doesn't support XMLHttpRequest");
        > > return null;
        > > }
        > >
        >
        > JsLint says:
        > *Problem at line 6 character 58: 'e' is already defined.
        > Problem at line 7 character 61: 'e' is already defined.
        > Problem at line 8 character 62: 'e' is already defined.
        > *
        > JC
        >
        >
        > [Non-text portions of this message have been removed]
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.