|
I can fix this by not doing a copy of the block's host frame, but that would break other things. I'm going to poke around MRI a bit to see where backrefs are actually supposed to be located.
This snippit, and a quick examination of the code, leads me to believe Ruby stores $~ and $_ in the topmost enclosing scope:
~/NetBeansProjects/jruby ➔ ruby -e "def foo; yield; end; 'foo' =~ /(foo)/; foo { 'bar' =~ /(bar)/ }; p \$~[0]"
"bar"
We need more specs for $~ and $_ for sure though, and we need to find a way around the frame copying. Pretty sure now this is a side effect of the proc that's involved; since we clone the frame the proc is associated with (to keep it safe across threads, avoid it wiping out threads that are being used for other things). So if we can fix the cloning of frames in procs, we will probably have this.
I added some specs for $~ and $_. Revision 6654 still fails.
Fixed by framing changes in r6696, with a test added in r6698.
great Charles! I can confirm that ZenTest/autotest is working out-of-the-box.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It's a quick fix until this issue gets resolved.