[MacRuby] #422: Kernel#caller compatibilty
MacRuby
ruby-noreply at macosforge.org
Thu Nov 25 00:16:15 PST 2010
#422: Kernel#caller compatibilty
-------------------------------------+--------------------------------------
Reporter: mattaimonetti@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
-------------------------------------+--------------------------------------
Old description:
> In a file:
>
> {{{
> class Foo
> def self.bar
> puts caller(1)
> end
> end
>
> Foo.bar
> }}}
>
> macruby:
> {{{
> core:in `caller:'
> simple_caller.rb:3:in `bar'
> simple_caller.rb:7:in `<main>'
> }}}
>
> ruby1.9:
> {{{
> simple_caller.rb:7:in `<main>'
> }}}
>
> A tiny bit more advanced example:
>
> {{{
> class Foo
> def self.bar
> baz do
> puts caller(1)
> end
> end
>
> def self.baz(&block)
> block.call
> end
> end
>
> Foo.bar
> }}}
>
> macruby:
>
> {{{
> core:in `caller:'
> caller_proc.rb:9:in `baz'
> caller_proc.rb:3:in `bar'
> caller_proc.rb:13:in `<main>'
> }}}
>
> ruby1.9:
>
> {{{
> caller_proc.rb:9:in `call'
> caller_proc.rb:9:in `baz'
> caller_proc.rb:3:in `bar'
> caller_proc.rb:13:in `<main>
> }}}
>
> Files attached.
New description:
In a file:
Example:
{{{
class Foo
def self.bar
baz do
puts caller(1)
end
end
def self.baz(&block)
block.call
end
end
Foo.bar
}}}
macruby:
{{{
core:in `caller:'
caller_proc.rb:9:in `baz'
caller_proc.rb:3:in `bar'
caller_proc.rb:13:in `<main>'
}}}
ruby1.9:
{{{
caller_proc.rb:9:in `call'
caller_proc.rb:9:in `baz'
caller_proc.rb:3:in `bar'
caller_proc.rb:13:in `<main>
}}}
Files attached.
--
Comment(by mattaimonetti@…):
The first example now works fine, block calls still don't get listed in
the caller list so I'm leaving this ticket open.
--
Ticket URL: <http://www.macruby.org/trac/ticket/422#comment:3>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list