Skip to content

Commit bcf17f5

Browse files
committed
Runner: Fix the bad code because of rebase
Signed-off-by: Ce Gao <[email protected]>
1 parent 291ee0a commit bcf17f5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/rprocessing/RLangPApplet.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import javax.script.ScriptEngine;
1313
import javax.script.ScriptEngineManager;
14+
import javax.script.ScriptException;
1415

1516
import org.renjin.eval.EvalException;
1617
import org.renjin.parser.RParser;
@@ -98,8 +99,12 @@ public RLangPApplet(final String programText, final Printer stdout) throws NotFo
9899
this.mode = this.detectMode();
99100
}
100101

101-
public void evaluateCoreCode() throws ScriptException {
102-
this.renjinEngine.eval(CORE_TEXT);
102+
public void evaluateCoreCode() throws RSketchError {
103+
try {
104+
this.renjinEngine.eval(CORE_TEXT);
105+
} catch (final ScriptException se) {
106+
throw toSketchException(se);
107+
}
103108
}
104109

105110
/**

src/rprocessing/Runner.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package rprocessing;
22

3-
import javax.script.ScriptException;
4-
5-
63
import rprocessing.exception.NotFoundException;
74
import rprocessing.exception.RSketchError;
85
import rprocessing.lancher.StandaloneSketch;
@@ -17,8 +14,6 @@
1714
public class Runner {
1815

1916
public static RunnableSketch sketch;
20-
private static final String CORE_TEXT =
21-
RScriptReader.readResourceAsText(Runner.class, "r/core.R");
2217

2318
private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("VERBOSE_RLANG_MODE"));
2419

@@ -63,6 +58,7 @@ public static synchronized void runSketchBlocking(final RunnableSketch sketch,
6358
RLangPApplet rp = new RLangPApplet(sketch.getMainCode(), stdout);
6459
log("Adding processing variable into R top context.");
6560
rp.addPAppletToRContext();
61+
rp.evaluateCoreCode();
6662

6763
rp.runBlock(args);
6864
}

0 commit comments

Comments
 (0)