diff --git a/array.c b/array.c index 07b3df0861..2876548085 100644 --- a/array.c +++ b/array.c @@ -996,6 +996,12 @@ rb_check_to_array(VALUE ary) return rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a); } +VALUE +rb_to_array(VALUE ary) +{ + return rb_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a); +} + /* * call-seq: * Array.try_convert(object) -> object, new_array, or nil diff --git a/internal/array.h b/internal/array.h index 44c0efbbc1..00e03c116e 100644 --- a/internal/array.h +++ b/internal/array.h @@ -29,6 +29,7 @@ VALUE rb_ary_tmp_new_fill(long capa); VALUE rb_ary_at(VALUE, VALUE); size_t rb_ary_memsize(VALUE); VALUE rb_to_array_type(VALUE obj); +VALUE rb_to_array(VALUE obj); void rb_ary_cancel_sharing(VALUE ary); static inline VALUE rb_ary_entry_internal(VALUE ary, long offset);