loop() to return StopIteration#result; [ruby-bugs#11498]

This commit is contained in:
Yukihiro "Matz" Matsumoto
2015-10-21 21:47:43 +09:00
parent 7278fd1f1b
commit 48771a357c
+2 -2
View File
@@ -30,8 +30,8 @@ module Kernel
while true
yield
end
rescue StopIteration
nil
rescue StopIteration => e
e.result
end
# 11.4.4 Step c)