Project

General

Profile

Actions

Bug #10775

closed

"break" from a block with nested begin-rescue became impossible

Added by misumi_rize (MISUMI Rize) over 9 years ago. Updated about 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-01-23 trunk 49389) [x86_64-darwin14]
[ruby-core:67765]

Description

"break" from a block with nested begin-rescue became impossible.

Example(it is valid on Ruby 2.2.0, 2.1.5):

2.times do
  begin
    raise
  rescue
    begin
      raise
    rescue
      break
    end
  end
end

Output:

test.rb:8:in `rescue in rescue in block in <main>': break from proc-closure (LocalJumpError)
	from test.rb:5:in `rescue in block in <main>'
	from test.rb:2:in `block in <main>'
	from test.rb:1:in `each'
	from test.rb:1:in `<main>'

I wrote test and fix on GitHub. Please see the pull request.


Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #11108: Unexpected LocalJumpError from "break" in nested begin blockClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0