Skip to content

Commit d85efbd

Browse files
committed
ScriptInterpreter: return result of the evaluation
The ScriptEngine#eval method returns a result. Let's pass it along.
1 parent 69317b2 commit d85efbd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/org/scijava/script/DefaultScriptInterpreter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ public synchronized String walkHistory(final String currentCommand,
8383
}
8484

8585
@Override
86-
public void eval(final String command) throws ScriptException {
86+
public Object eval(final String command) throws ScriptException {
8787
if (history != null) history.add(command);
8888
if (engine == null) throw new java.lang.IllegalArgumentException();
89-
engine.eval(command);
89+
return engine.eval(command);
9090
}
9191

9292
@Override

src/main/java/org/scijava/script/ScriptInterpreter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ public interface ScriptInterpreter {
6565
* Evaluates a command.
6666
*
6767
* @param command the command to evaluate
68+
* @return result of the evaluation
6869
* @throws ScriptException
6970
*/
70-
void eval(String command) throws ScriptException;
71+
Object eval(String command) throws ScriptException;
7172

7273
/**
7374
* Returns the associated {@link ScriptLanguage}.

0 commit comments

Comments
 (0)