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

parent 7278fd1f
......@@ -30,8 +30,8 @@ module Kernel
while true
yield
end
rescue StopIteration
nil
rescue StopIteration => e
e.result
end
# 11.4.4 Step c)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment