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

Re: Problems

Expand Messages
  • 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 1 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.