diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-01-03 11:34:35 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-01-03 11:34:35 +0900 |
| commit | cca19532c5f71e1bdc0b4947b2fcddd181f27781 (patch) | |
| tree | c65545fead5be8f7c7a5d4010fc12c4823751d55 /mrblib | |
| parent | f9d89e3fa592706de6a6dee701af3961df914292 (diff) | |
| download | mruby-cca19532c5f71e1bdc0b4947b2fcddd181f27781.tar.gz mruby-cca19532c5f71e1bdc0b4947b2fcddd181f27781.zip | |
Remove `Kernel#class_defined?` which is not available in CRuby; #3829
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/float.rb | 2 | ||||
| -rw-r--r-- | mrblib/numeric.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/mrblib/float.rb b/mrblib/float.rb index 2b86dc1e5..421b8d851 100644 --- a/mrblib/float.rb +++ b/mrblib/float.rb @@ -6,4 +6,4 @@ class Float # mruby special - since mruby integers may be upgraded to floats, # floats should be compatible to integers. include Integral -end if class_defined?("Float") +end if Object.const_defined?(:Float) diff --git a/mrblib/numeric.rb b/mrblib/numeric.rb index 1b11e92ad..a2eb9c450 100644 --- a/mrblib/numeric.rb +++ b/mrblib/numeric.rb @@ -104,7 +104,7 @@ module Integral raise ArgumentError, "step can't be 0" if step == 0 return to_enum(:step, num, step) unless block - i = if class_defined?("Float") && num.kind_of?(Float) then self.to_f else self end + i = if Object.const_defined?(:Float) && num.kind_of?(Float) then self.to_f else self end if num == nil while true block.call(i) |
