------ art_4609_3406158.1215032625943
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
This manifests itself in rescues as well:
def caller_in_eval
eval("raise 'w00t'")
end
def method_with_block
begin
yield
rescue
p "method_with_block"
end
end
method_with_block do
begin
caller_in_eval
rescue
p "calling m_w_b"
end
end
You would expect to see "method_with_block" but instead get "calling m_w_b"
-- Yehuda
On Tue, Jul 1, 2008 at 11:44 AM, Wilson Bilkovich <wilsonb / gmail.com> wrote:
> On 6/19/08, Wilson Bilkovich <wilsonb / gmail.com> wrote:
> > I am trying to understand what Ruby 1.8 outputs when "caller" is invoked.
> > I am working on making Rubinius produce compatible results, but there
> > are some scenarios I have not been able to understand. The one
> > outlined below looks like a Ruby bug to me.
> >
> > Can someone confirm or deny that for me?
> >
> > Here is a test script that shows a medium-complexity call to 'caller':
> > ...
>
> Unless there is an objection, I will file this on the bug tracker.
>
> Regards,
> --Wilson.
>
>
--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325
------ art_4609_3406158.1215032625943
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
This manifests itself in rescues as well:<br><br>def caller_in_eval<br> eval("raise 'w00t'")<br>end<br><br>def method_with_block<br> begin<br> yield<br> rescue<br> p "method_with_block"<br>
end<br>end<br><br>method_with_block do<br> begin<br> caller_in_eval<br> rescue<br> p "calling m_w_b"<br> end<br>end<br><br>You would expect to see "method_with_block" but instead get "calling m_w_b"<br>
<br>-- Yehuda<br><br><div class mail_quote">On Tue, Jul 1, 2008 at 11:44 AM, Wilson Bilkovich <<a href ailto:wilsonb / gmail.com">wilsonb / gmail.com</a>> wrote:<br><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class h2E3d">On 6/19/08, Wilson Bilkovich <<a href ailto:wilsonb / gmail.com">wilsonb / gmail.com</a>> wrote:<br>
> I am trying to understand what Ruby 1.8 outputs when "caller" is invoked.<br>
> I am working on making Rubinius produce compatible results, but there<br>
> are some scenarios I have not been able to understand. The one<br>
> outlined below looks like a Ruby bug to me.<br>
><br>
> Can someone confirm or deny that for me?<br>
><br>
> Here is a test script that shows a medium-complexity call to 'caller':<br>
</div>> ...<br>
<br>
Unless there is an objection, I will file this on the bug tracker.<br>
<br>
Regards,<br>
<font color 888888">--Wilson.<br>
<br>
</font></blockquote></div><br><br clear
ll"><br>-- <br>Yehuda Katz<br>Developer | Engine Yard<br>(ph) 718.877.1325
------ art_4609_3406158.1215032625943--