File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/main/java/org/scijava/plugins/scripting/javascript Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,28 @@ public JavaScriptScriptLanguage() {
5959 super ("javascript" );
6060 }
6161
62+ // -- JavaScriptScriptLanguage methods --
63+
64+ /**
65+ * Returns true iff this script language is using the <a
66+ * href="http://openjdk.java.net/projects/nashorn/">Nashorn</a> JavaScript
67+ * engine. This is the case for Java 8.
68+ */
69+ public boolean isNashorn () {
70+ return getEngineName ().contains ("Nashorn" );
71+ }
72+
73+ /**
74+ * Returns true iff this script language is using the <a
75+ * href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino"
76+ * >Rhino</a> JavaScript engine. This is the case for Java 6 and Java 7.
77+ */
78+ public boolean isRhino () {
79+ return getEngineName ().contains ("Rhino" );
80+ }
81+
82+ // -- ScriptEngineFactory methods --
83+
6284 @ Override
6385 public ScriptEngine getScriptEngine () {
6486 final ScriptEngine engine = super .getScriptEngine ();
You can’t perform that action at this time.
0 commit comments