Skip to content

Commit

Permalink
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion spec/truffle/tags/core/kernel/loop_tags.txt

This file was deleted.

5 changes: 4 additions & 1 deletion truffle/src/main/ruby/core/kernel.rb
Original file line number Diff line number Diff line change
@@ -326,12 +326,15 @@ def load(filename, wrap = false)
def loop
return to_enum(:loop) { Float::INFINITY } unless block_given?

result = nil
begin
while true
yield
end
rescue StopIteration
rescue StopIteration => si
result = si.result
end
result
end
module_function :loop

0 comments on commit db308fe

Please sign in to comment.