mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Make Array.new to accept both integers and floats.
This time we used `Integral` module which is mruby specific.
This commit is contained in:
+1
-1
@@ -66,7 +66,7 @@ class Array
|
||||
#
|
||||
# ISO 15.2.12.5.15
|
||||
def initialize(size=0, obj=nil, &block)
|
||||
raise TypeError, "expected Integer for 1st argument" unless size.kind_of? Integer
|
||||
raise TypeError, "expected Integer for 1st argument" unless size.kind_of? Integral
|
||||
raise ArgumentError, "negative array size" if size < 0
|
||||
|
||||
self.clear
|
||||
|
||||
Reference in New Issue
Block a user