Projects

Ticket #386 (closed defect: fixed)

Opened 11 months ago

Last modified 11 months ago

binding with block does not work

Reported by: jazzbox@… Owned by: lsansonetti@…
Priority: critical Milestone: MacRuby 0.5
Component: MacRuby Keywords:
Cc:

Description

$ cat y.rb 
class Foo
  def get_binding
    binding
  end
end

b = Foo.new.get_binding { "got it"}

p eval "block_given?", b
p eval "yield", b
$ macruby y.rb 
false
(eval):in `<main>': no block given (LocalJumpError)
	from core:in `eval:'
	from y.rb:in `<main>'
$ ruby y.rb 
true
"got it"

I added a failing test for test_vm/eval.rb

Attachments

0001-add-failing-tests-binding-with-block.patch Download (0.8 KB) - added by jazzbox@… 11 months ago.

Change History

Changed 11 months ago by jazzbox@…

Changed 11 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed

Thanks for the test case, I merged it and fixed the problem in r2819.

Note: See TracTickets for help on using tickets.