test/nashorn/script/nosecurity/JDK-8165198.js
changeset 48407 fcb5b835bf32
parent 47437 54a2f246edd8
--- a/test/nashorn/script/nosecurity/JDK-8165198.js	Wed Dec 20 13:28:23 2017 -0800
+++ b/test/nashorn/script/nosecurity/JDK-8165198.js	Thu Dec 21 10:26:03 2017 +0100
@@ -30,8 +30,11 @@
 
 var NashornScriptEngineFactory = Java.type("jdk.nashorn.api.scripting.NashornScriptEngineFactory");
 var e = new NashornScriptEngineFactory().getScriptEngine("-ot=false");
-var output = e.eval("with(new JavaImporter(java.util)){x}");
-print(output);
+try {
+    e.eval("with(new JavaImporter(java.util)){x}");
+} catch (e) {
+    print(e);
+}
 e.eval("with(new JavaImporter(java.util)){x=1}");
 var output2 = e.eval("with(new JavaImporter(java.util)){x}");
 print(output2);