Hi,
We're writing some new RubySpec tests for Kernel#eval, and I noticed
one interesting difference between MRI 1.8 and 1.9 behaviors:
1. ruby -ve "p eval('yield') { 'blah' }"
ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
"blah"
2. ruby -ve "p eval('yield') { 'blah' }"
ruby 1.9.0 (2008-05-31 revision 0) [i686-linux]
-e:1:in `eval': no block given (yield) (LocalJumpError)
Essentially, MRI 1.8 when eval'ing 'yield', actually yields to the
block, supplied to eval.
MRI 1.9 does not like that.
I'd like to double-check with ruby-core, is this change in behavior
intentional, is it a bug or a feature?
Thanks,
--Vladimir