mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Array#join to accept only strings as sep
This commit is contained in:
+2
-2
@@ -1006,7 +1006,7 @@ mrb_ary_join(mrb_state *mrb, mrb_value ary, mrb_value sep)
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* ary.join(sep=nil) -> str
|
||||
* ary.join(sep="") -> str
|
||||
*
|
||||
* Returns a string created by converting each element of the array to
|
||||
* a string, separated by <i>sep</i>.
|
||||
@@ -1020,7 +1020,7 @@ mrb_ary_join_m(mrb_state *mrb, mrb_value ary)
|
||||
{
|
||||
mrb_value sep = mrb_nil_value();
|
||||
|
||||
mrb_get_args(mrb, "|o", &sep);
|
||||
mrb_get_args(mrb, "|S", &sep);
|
||||
return mrb_ary_join(mrb, ary, sep);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user