summaryrefslogtreecommitdiffhomepage
path: root/mrblib
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-10-21 21:47:43 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-10-21 21:47:43 +0900
commit48771a357cbfb4ce86764a420997c0df5f5ee5b2 (patch)
tree27cf887745a8910e0c715ea8c4d76a0cd9d90274 /mrblib
parent7278fd1f1bdd9cf1b62931ecaa1b495edc24465c (diff)
downloadmruby-48771a357cbfb4ce86764a420997c0df5f5ee5b2.tar.gz
mruby-48771a357cbfb4ce86764a420997c0df5f5ee5b2.zip
loop() to return StopIteration#result; [ruby-bugs#11498]
Diffstat (limited to 'mrblib')
-rw-r--r--mrblib/kernel.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrblib/kernel.rb b/mrblib/kernel.rb
index 38af3b310..550ae8172 100644
--- a/mrblib/kernel.rb
+++ b/mrblib/kernel.rb
@@ -30,8 +30,8 @@ module Kernel
while true
yield
end
- rescue StopIteration
- nil
+ rescue StopIteration => e
+ e.result
end
# 11.4.4 Step c)