Skip to content

Commit 8c05f67

Browse files
committed
JavaScriptScriptLanguage: minor code cleanup
This brings it closer to, but not 100% in line with, the style template.
1 parent 16cd066 commit 8c05f67

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/main/java/org/scijava/plugins/scripting/javascript/JavaScriptScriptLanguage.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ public ScriptEngine getScriptEngine() {
9191
}
9292
if (isRhino()) {
9393
// for the load function, which is somehow otherwise unavailable (?)
94-
engine.eval("function load(path) {\n"
95-
+ " importClass(Packages." + contextClass(engine) + ");\n"
96-
+ " importClass(Packages.java.io.FileReader);\n"
97-
+ " var cx = Context.getCurrentContext();\n"
98-
+ " cx.evaluateReader(this, new FileReader(path), path, 1, null);\n"
99-
+ "}");
94+
engine.eval("function load(path) {\n" +
95+
" importClass(Packages." + contextClass(engine) + ");\n" +
96+
" importClass(Packages.java.io.FileReader);\n" +
97+
" var cx = Context.getCurrentContext();\n" +
98+
" cx.evaluateReader(this, new FileReader(path), path, 1, null);\n" +
99+
"}");
100100
}
101101
}
102-
catch (ScriptException e) {
102+
catch (final ScriptException e) {
103103
e.printStackTrace();
104104
}
105105
return engine;

0 commit comments

Comments
 (0)