You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jruby-complete-9.1.6.0.jar and current master
Windows 7 and Linux
Java 1.8.0_131 Oracle JDK 64 bit
Expected Behavior
With:
System.setProperty("org.jruby.embed.localvariable.behavior", "transient");
// or System.setProperty("org.jruby.embed.localvariable.behavior", "persistent");
ScriptEngine engine = new ScriptEngineManager().getEngineByName("jruby");
engine.eval("require 'date'");
engine.eval("Date.new");
engine.eval("require 'date'");
engine.eval("Date.new");
this should produce nothing.
Actual Behavior
Throws exception:
NoMethodError: undefined method `>' for nil:NilClass
civil at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/date.rb:829
<main> at <script>:1
Exception in thread "main" javax.script.ScriptException: org.jruby.embed.EvalFailedException: (NoMethodError) undefined method `>' for nil:NilClass
at org.jruby.embed.jsr223.JRubyEngine.wrapException(JRubyEngine.java:104)
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:93)
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:142)
at Main.main(Main.java:13)
Caused by: org.jruby.embed.EvalFailedException: (NoMethodError) undefined method `>' for nil:NilClass
at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:131)
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:90)
... 2 more
Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `>' for nil:NilClass
at RUBY.civil(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/date.rb:829)
at RUBY.<main>(<script>:1)
Replacing date.rb with:
class Date
ABC = 2
def initialize
puts "ABC: #{ABC.nil?}"
end
end
Shows that the constant ABC becomes nil the second time Date.new is run. This is fine if the constant is named 'A' though.
The text was updated successfully, but these errors were encountered:
Environment
jruby-complete-9.1.6.0.jar and current master
Windows 7 and Linux
Java 1.8.0_131 Oracle JDK 64 bit
Expected Behavior
With:
this should produce nothing.
Actual Behavior
Throws exception:
Replacing date.rb with:
Shows that the constant ABC becomes nil the second time
Date.new
is run. This is fine if the constant is named 'A' though.The text was updated successfully, but these errors were encountered: