Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #25491

Re: Nested try catch

From Joao Rodrigues <groups_jr-1@yahoo.com>
Newsgroups comp.lang.javascript
Subject Re: Nested try catch
Date 2014-07-21 00:19 -0300
Organization Aioe.org NNTP Server
Message-ID <lqi0rg$42v$1@speranza.aioe.org> (permalink)
References <7rSdna_x9Z-mw1HOnZ2dnUVZ_vWdnZ2d@westnet.com.au>

Show all headers | View raw


On 07/20/2014 09:23 PM, Andrew Poulos wrote:
> If I have this
>
> try {
>    // blah
> } catch(e) {
>    try {
>      // blah 2
>    } catch(e) {}
> }
>
> jslint.com says "'e' is already defined" - fair enough.

Maybe this is due to an old problem with the try...catch block in IE 8 
and earlier.


> But if I change
> it to
>
> try {
>    // blah
> } catch(e) {
>    try {
>      // blah 2
>    } catch(e2) {}
> }
>
> jslint.com says "Expected 'ignore' and instead saw 'e2'".
>
> Is 'ignore' just a variable name that jslint.com prefers?

Yes, "ignore" is meant to be used as one of the "Crockfordian" 
assumptions. See the 'ignore' check in the jslint code:
<https://github.com/douglascrockford/JSLint/blob/master/jslint.js>

<http://stackoverflow.com/questions/16613790/jslint-error-expected-ignore-and-instead-saw-ex>

-- 
Joao Rodrigues

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Nested try catch Andrew Poulos <ap_prog@hotmail.com> - 2014-07-21 10:23 +1000
  Re: Nested try catch Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-21 03:58 +0200
  Re: Nested try catch Joao Rodrigues <groups_jr-1@yahoo.com> - 2014-07-21 00:19 -0300
  Re: Nested try catch Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2014-07-21 08:37 +0200
  Re: Nested try catch "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-07-21 05:09 -0700

csiph-web