Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScriptEngine.put doesn't work with JRuby 9.2.0.0 #5207

Closed
pajswigger opened this issue Jun 4, 2018 · 2 comments
Closed

ScriptEngine.put doesn't work with JRuby 9.2.0.0 #5207

pajswigger opened this issue Jun 4, 2018 · 2 comments
Milestone

Comments

@pajswigger
Copy link

Environment

jruby-complete-9.2.0.0.jar
MacOS Darwin

Expected Behavior

import org.jruby.embed.jsr223.JRubyEngineFactory;
import javax.script.ScriptEngine;

public class jruby
{
    public static void main(String[] args) throws Exception
    {
        ScriptEngine scriptEngine = new JRubyEngineFactory().getScriptEngine();
        scriptEngine.put("foo", "bar");
        scriptEngine.eval("puts $foo");
    }
}

With JRuby 9.1.12.0 this outputs "bar" as expected.

Actual Behavior

With JRuby 9.2.0.0 the output is empty

$ java -cp jruby-complete-9.1.12.0.jar:. jruby
bar
$ java -cp jruby-complete-9.2.0.0.jar:. jruby

@kares
Copy link
Member

kares commented Jun 4, 2018

but scriptEngine.eval("puts foo") likely does? ... if I recall right the var scope was switched to local

@pajswigger
Copy link
Author

I see, yes it does. Ok, as the change is intentional we can work around it on our side.

@kares kares added this to the Won't Fix milestone Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants