[MacRuby] #1177: Hash.each doesn't exit on embedded return
MacRuby
ruby-noreply at macosforge.org
Thu Mar 3 14:26:26 PST 2011
#1177: Hash.each doesn't exit on embedded return
-------------------------------+--------------------------------------------
Reporter: dopperman@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords: Hash each
-------------------------------+--------------------------------------------
Comment(by dopperman@…):
def weirdness
map = Hash[ 'a', 1, 'b', 2]
#map.keys.each do |a| # this works
map.each_key do |a| # bug lies here
puts 'leaving...'
return
end
end
weirdness
this produces:
leaving...
leaving...
--
Ticket URL: <http://www.macruby.org/trac/ticket/1177#comment:1>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list