test/javax/script/Helper.java
Print this page
*** 22,38 ****
*/
import javax.script.*;
/**
* Helper class to consolidate testing requirements for a js engine.
! * A js engine is required as part of Sun's product JDK.
*/
public class Helper {
private Helper() {}; // Don't instantiate
public static ScriptEngine getJsEngine(ScriptEngineManager m) {
! ScriptEngine e = m.getEngineByName("js");
if (e == null &&
System.getProperty("java.runtime.name").startsWith("Java(TM)")) {
// A js engine is requied for Sun's product JDK
throw new RuntimeException("no js engine found");
}
--- 22,38 ----
*/
import javax.script.*;
/**
* Helper class to consolidate testing requirements for a js engine.
! * A js engine is required as part of Oracle's product JDK.
*/
public class Helper {
private Helper() {}; // Don't instantiate
public static ScriptEngine getJsEngine(ScriptEngineManager m) {
! ScriptEngine e = m.getEngineByName("nashorn");
if (e == null &&
System.getProperty("java.runtime.name").startsWith("Java(TM)")) {
// A js engine is requied for Sun's product JDK
throw new RuntimeException("no js engine found");
}