Skip to content

Commit 13635a3

Browse files
committed
Pass error class explicitly for clarity
1 parent 2412627 commit 13635a3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def self.srand(seed = undefined)
6767
end
6868

6969
def self.rand(limit = undefined)
70-
Truffle::RandomOperations.random(Primitive.thread_randomizer, limit)
70+
Truffle::RandomOperations.random(Primitive.thread_randomizer, limit, TypeError)
7171
end
7272

7373
def self.urandom(size)
@@ -88,7 +88,7 @@ def initialize(seed = undefined)
8888
end
8989

9090
def rand(limit = undefined)
91-
Truffle::RandomOperations.random(@randomizer, limit)
91+
Truffle::RandomOperations.random(@randomizer, limit, TypeError)
9292
end
9393

9494
def seed

src/main/ruby/truffleruby/core/truffle/random_operations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Truffle
1212
module RandomOperations
1313

1414
# MRI: rand_random
15-
def self.random(randomizer, limit, error = TypeError)
15+
def self.random(randomizer, limit, error)
1616
if Primitive.undefined?(limit)
1717
return randomizer.random_float
1818
end

0 commit comments

Comments
 (0)