mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
loop() to return StopIteration#result; [ruby-bugs#11498]
This commit is contained in:
+2
-2
@@ -30,8 +30,8 @@ module Kernel
|
||||
while true
|
||||
yield
|
||||
end
|
||||
rescue StopIteration
|
||||
nil
|
||||
rescue StopIteration => e
|
||||
e.result
|
||||
end
|
||||
|
||||
# 11.4.4 Step c)
|
||||
|
||||
Reference in New Issue
Block a user