Add `Array.new([1,2,3])` initialization.

parent aa4d8e9a
......@@ -66,6 +66,10 @@ class Array
#
# ISO 15.2.12.5.15
def initialize(size=0, obj=nil, &block)
if size.is_a?(Array) && obj==nil && block == nil
self.replace(size)
return self
end
size = size.__to_int
raise ArgumentError, "negative array size" if size < 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment