------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>&nbsp; eval(&quot;raise &#39;w00t&#39;&quot;)<br>end<br><br>def method_with_block<br>&nbsp; begin<br>&nbsp;&nbsp;&nbsp; yield<br>&nbsp; rescue<br>&nbsp;&nbsp;&nbsp; p &quot;method_with_block&quot;<br>
&nbsp; end<br>end<br><br>method_with_block do<br>&nbsp; begin<br>&nbsp;&nbsp;&nbsp; caller_in_eval<br>&nbsp; rescue<br>&nbsp;&nbsp;&nbsp; p &quot;calling m_w_b&quot;<br>&nbsp; end<br>end<br><br>You would expect to see &quot;method_with_block&quot; but instead get &quot;calling m_w_b&quot;<br>
<br>-- Yehuda<br><br><div classmail_quote">On Tue, Jul 1, 2008 at 11:44 AM, Wilson Bilkovich &lt;<a hrefailto:wilsonb / gmail.com">wilsonb / gmail.com</a>&gt; wrote:<br><blockquote classmail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div classh2E3d">On 6/19/08, Wilson Bilkovich &lt;<a hrefailto:wilsonb / gmail.com">wilsonb / gmail.com</a>&gt; wrote:<br>
&gt; I am trying to understand what Ruby 1.8 outputs when &quot;caller&quot; is invoked.<br>
&gt; &nbsp;I am working on making Rubinius produce compatible results, but there<br>
&gt; &nbsp;are some scenarios I have not been able to understand. &nbsp;The one<br>
&gt; &nbsp;outlined below looks like a Ruby bug to me.<br>
&gt;<br>
&gt; &nbsp;Can someone confirm or deny that for me?<br>
&gt;<br>
&gt; &nbsp;Here is a test script that shows a medium-complexity call to &#39;caller&#39;:<br>
</div>&gt; ...<br>
<br>
Unless there is an objection, I will file this on the bug tracker.<br>
<br>
Regards,<br>
<font color888888">--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--