Skip to content

Commit a205319

Browse files
committed
[GR-20446] Remove incorrect Proc.new usage
PullRequest: truffleruby/2187
2 parents 7919f63 + 564354e commit a205319

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/ruby/truffleruby/core/enumerable.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def chunk(&original_block)
7373
end
7474

7575
def chunk_while(&block)
76-
block = Proc.new(block)
76+
raise ArgumentError, 'tried to create Proc object without a block' unless block
7777
Enumerator.new do |yielder|
7878
accumulator = nil
7979
prev = nil
@@ -245,7 +245,7 @@ def slice_before(arg = undefined, &block)
245245
end
246246

247247
def slice_when(&block)
248-
block = Proc.new(block)
248+
raise ArgumentError, 'tried to create Proc object without a block' unless block
249249
Enumerator.new do |yielder|
250250
accumulator = nil
251251
prev = nil

0 commit comments

Comments
 (0)