|
I guess this should be reopened... With JRuby 1.1.4...
I get :
And with jRuby 1.1.5 : C:\apps\jruby-1.1.5\bin>.\jruby -ve "p eval('yield') { 'vvs' }"
jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-03 rev 7996) [x86-java]
org.jruby.runtime.ThreadContext:638:in `addBackTraceElement': java.lang.NullPointerException
from org.jruby.runtime.ThreadContext:748:in `createBacktraceFromFrames'
from org.jruby.runtime.ThreadContext:707:in `createBacktraceFromFrames'
from org.jruby.RubyException:178:in `initBacktrace'
from org.jruby.RubyException:164:in `getBacktrace'
from org.jruby.RubyException:197:in `backtrace'
from org.jruby.RubyException$i_method_0_0$RUBYINVOKER$backtrace:-1:in `call'
from org.jruby.RubyClass:428:in `finvoke'
from org.jruby.javasupport.util.RuntimeHelpers:302:in `invoke'
from org.jruby.RubyObject:689:in `callMethod'
from org.jruby.Ruby:2040:in `printError'
from org.jruby.Main:235:in `run'
from org.jruby.Main:100:in `run'
from org.jruby.Main:84:in `main'
Emmanuel: The behavior you demonstrate is exactly the behavior that ruby-core has deemed "unspecified". It's a side effect of the way 1.8 is designed, and should not be expected to work under 1.9 or JRuby. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I've fixed the issue with eval 'yield', binding in r6886. The other failures, where a block is passed directly to yield, have been confirmed as unintentional behavior in Ruby 1.8, so we're not going to fix them. And they seem really wrong anyway.