diff options
author | sundar <none@none> | 2014-04-02 15:52:31 +0530 |
---|---|---|
committer | sundar <none@none> | 2014-04-02 15:52:31 +0530 |
commit | c9e2e258e421bbd3d889380801fa83b5154e3f1d (patch) | |
tree | 3a3b9010bee78e6fe2ca8d65f8a8b527d9699938 /src | |
parent | 422e2eae318d9765f9580eaea24f006f62b8a653 (diff) | |
download | nashorn-c9e2e258e421bbd3d889380801fa83b5154e3f1d.tar.gz |
8039047: Parser accepts conditional catch clauses even when --no-syntax-extensions / -nse option is passed
Reviewed-by: lagergren, attila
Diffstat (limited to 'src')
-rw-r--r-- | src/jdk/nashorn/internal/parser/Parser.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jdk/nashorn/internal/parser/Parser.java b/src/jdk/nashorn/internal/parser/Parser.java index f6b962a9..08ff725a 100644 --- a/src/jdk/nashorn/internal/parser/Parser.java +++ b/src/jdk/nashorn/internal/parser/Parser.java @@ -1700,9 +1700,11 @@ loop: // ECMA 12.4.1 strict mode restrictions verifyStrictIdent(exception, "catch argument"); - // Check for conditional catch. + // 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 (type == IF) { + if (!env._no_syntax_extensions && type == IF) { next(); // Get the exception condition. ifExpression = expression(); |