Issue Type: Bug Bug
Affects Versions: JRuby 1.7.0
Assignee: Thomas E Enebo
Created: 14/Nov/12 12:27 PM
Description:

If you have an exception raised in #each method, the actual exception is StopIteration.

Note that Enumerator.new is used due to JRUBY-6581.

Test case:

class MyError < Exception; end

class Test
  def each
    yield 1
    raise MyError.new
  end
end

obj = Test.new
enum = Enumerator.new(obj)

begin
  puts enum.next # => 1
  puts enum.next # => MyError raised
rescue MyError
  puts "ok"
rescue
  puts "fail"
end

MRI, RBX output:

1
ok

JRuby output:

fail
Project: JRuby
Priority: Major Major
Reporter: Vladimir Pouzanov
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to