src/jdk/nashorn/internal/parser/Parser.java
Print this page
*** 1698,1710 ****
final IdentNode exception = getIdent();
// ECMA 12.4.1 strict mode restrictions
verifyStrictIdent(exception, "catch argument");
! // Check for conditional catch.
final Expression ifExpression;
! if (type == IF) {
next();
// Get the exception condition.
ifExpression = expression();
} else {
ifExpression = null;
--- 1698,1712 ----
final IdentNode exception = getIdent();
// ECMA 12.4.1 strict mode restrictions
verifyStrictIdent(exception, "catch argument");
! // Nashorn extension: catch clause can have optional
! // condition. So, a single try can have more than one
! // catch clause each with it's own condition.
final Expression ifExpression;
! if (!env._no_syntax_extensions && type == IF) {
next();
// Get the exception condition.
ifExpression = expression();
} else {
ifExpression = null;