Project

General

Profile

Actions

Bug #1729

closed

Returning ignores ensure section when inside lambda

Bug #1729: Returning ignores ensure section when inside lambda

Added by bugmenot (bugmenot bugmenot) over 16 years ago. Updated over 14 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux]
Backport:
[ruby-core:24146]

Description

=begin
The following code does not run the code inside the ensure section when run in Ruby 1.9.1. When run under Ruby 1.8.7, the ensure section is correctly run. Is there any reason for this change in behavior?

foo = lambda do
begin
return
ensure
puts "hi mom"
end
end

foo.call
=end

Updated by bugmenot (bugmenot bugmenot) over 16 years ago Actions #1

=begin
I forgot to add that the same code works when it's in a regular function:

def bar
begin
return
ensure
puts "hi mom"
end
end

bar

It just fails when it's in a lambda.
=end

Updated by yugui (Yuki Sonoda) over 16 years ago Actions #2

  • Category set to YARV
  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)
  • Priority changed from Normal to 5

=begin

=end

Updated by wanabe (_ wanabe) about 16 years ago Actions #3

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24530.
=end

Actions

Also available in: PDF Atom