Skip to content

Commit

Permalink
Don't preEval here
Browse files Browse the repository at this point in the history
preEval is run later in doEval immediately before executing. Doing
it here appears to have caused some issue in either the parse or
the set-up of the scoping used by the parsed result (see
jruby#8346). Removing these pre-parse preEval calls fixes
the issue.

Fixes jruby#8346.
  • Loading branch information
headius committed Sep 10, 2024
1 parent be7815e commit 4581f5c
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ public class JRubyCompiledScript extends CompiledScript {
JRubyCompiledScript(ScriptingContainer container, JRubyEngine engine, String script) throws RaiseException {
this.container = container;
this.engine = engine;
Utils.preEval(container, engine.getContext());
unit = container.parse(script);
}

JRubyCompiledScript(ScriptingContainer container, JRubyEngine engine, Reader reader) throws RaiseException {
this.container = container;
this.engine = engine;
String filename = System.getProperty(ScriptEngine.FILENAME);
Utils.preEval(container, engine.getContext());
unit = container.parse(reader, filename, Utils.getLineNumber(engine.getContext()));
}

Expand Down

0 comments on commit 4581f5c

Please sign in to comment.