On Mon, Jun 14, 2010 at 4:18 PM, Michael Ficarra
<[email protected]> wrote:
> Javascript (not ECMAScript) specifications allow for the use of
> conditional catch statements of the form try { <statements> } catch( e
> if <condition> ) { <statements> }. Currently, caja throws an error
> stating that it was expecting a right parenthesis after the variable
> in the catch clause, not the "if" that it found. Is this functionality
> meant to be available to cajoled programs?

No, it isn't.  The standard way to do that is

try{...}
catch(e) {
   if (e instanceof X) {
     ...
   } else if (e instanceof Y) {
     ...
   } else {
     ...
   }
}

In a cursory review, I
> found no security risks associated with this construct nor any other
> reasons not to include it. The official specification is located at
> https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/try...catch#Conditional_catch_clauses
>

We're moving toward ES5 strict mode, so we won't be implementing that.
-- 
Mike Stay - [email protected]
http://www.cs.auckland.ac.nz/~mike
http://reperiendi.wordpress.com

Reply via email to