RFR 8072853: SimpleScriptContext used by NashornScriptEngine doesn't completely complies to the spec regarding exception throwing (original) (raw)
A. Sundararajan sundararajan.athijegannathan at oracle.com
Mon May 18 12:59:56 UTC 2015
- Previous message: RFR 8072853: SimpleScriptContext used by NashornScriptEngine doesn't completely complies to the spec regarding exception throwing
- Next message: RFR 8072853: SimpleScriptContext used by NashornScriptEngine doesn't completely complies to the spec regarding exception throwing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks for the review. Updated test as per your suggestion. Uploaded fresh review @ http://cr.openjdk.java.net/~sundar/8072853/webrev.01/
Thanks -Sundar
Paul Sandoz wrote:
On May 18, 2015, at 12:44 PM, A. Sundararajan <sundararajan.athijegannathan at oracle.com> wrote:
Please review http://cr.openjdk.java.net/~sundar/8072853/webrev.00/ for https://bugs.openjdk.java.net/browse/JDK-8072853
Changes to SimpleScriptContext look good. Test-wise you could reduce the duplication with a method accepting Consumer. e.g. @Test public void getAttributeEmptyName() { test(sc -> sc.getAttribute("", ScriptContext.GLOBALSCOPE)); } void test(Consumer c) { for (ScriptEngineFactory fac : getFactories()) { ScriptContext sc = fac.getScriptEngine().getContext(); String name = fac.getEngineName(); try { c.accept(sc); throw new RuntimeException("no exception for " + name); } catch (IllegalArgumentException iae) { System.out.println("got " + iae + " as expected for " + name); } } } Paul.
- Previous message: RFR 8072853: SimpleScriptContext used by NashornScriptEngine doesn't completely complies to the spec regarding exception throwing
- Next message: RFR 8072853: SimpleScriptContext used by NashornScriptEngine doesn't completely complies to the spec regarding exception throwing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]