mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* compile.c: fix to add "ensure" codes across "while" clause
before "return" expression. [ruby-dev:37967] * bootstraptest/test_flow.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cd2434deb6
commit
c9e4dc308f
3 changed files with 66 additions and 31 deletions
|
@ -200,7 +200,9 @@ assert_equal %q{[1, 2, 3, 5, 8, 9]}, %q{$a = []; begin; ; $a << 1
|
|||
end; $a << 8
|
||||
; $a << 9
|
||||
; rescue Exception; $a << 99; end; $a}
|
||||
assert_equal %q{[1, 2, 3, 5, 99]}, %q{$a = []; begin; ; $a << 1
|
||||
assert_equal %q{[1, 2, 3, 5, 99]}, %q{
|
||||
$a = [];
|
||||
begin; ; $a << 1
|
||||
while true; $a << 2
|
||||
begin; $a << 3
|
||||
break; $a << 4
|
||||
|
@ -488,4 +490,15 @@ assert_equal %q{[:ok, :ok2, :last]}, %q{
|
|||
a << :last
|
||||
end
|
||||
a
|
||||
}
|
||||
}
|
||||
assert_equal %Q{ENSURE\n}, %q{
|
||||
def test
|
||||
while true
|
||||
return
|
||||
end
|
||||
ensure
|
||||
puts("ENSURE")
|
||||
end
|
||||
test
|
||||
}, '[ruby-dev:37967]'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue