jdk/test/javax/script/Test5.java
changeset 1084 4d4d63dfdef9
parent 2 90ce3da70b43
child 1247 b4c26443dee5
--- a/jdk/test/javax/script/Test5.java	Sun Aug 17 17:02:04 2008 -0700
+++ b/jdk/test/javax/script/Test5.java	Mon Aug 18 15:28:54 2008 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6249843
+ * @bug 6249843 6705893
  * @summary Tests engine, global scopes and scope hiding.
  */
 
@@ -34,7 +34,11 @@
         public static void main(String[] args) throws Exception {
                 System.out.println("\nTest5\n");
                 ScriptEngineManager m = new ScriptEngineManager();
-                ScriptEngine engine = m.getEngineByName("js");
+                ScriptEngine engine = Helper.getJsEngine(m);
+                if (engine == null) {
+                    System.out.println("Warning: No js engine found; test vacuously passes.");
+                    return;
+                }
                 Bindings g = new SimpleBindings();
                 Bindings e = new SimpleBindings();
                 g.put("key", "value in global");