Skip to content

Commit

Permalink
Array#join to accept only strings as sep
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Jul 15, 2012
1 parent 72f7c51 commit 50f56a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/array.c
Expand Up @@ -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>.
Expand All @@ -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);
}

Expand Down

0 comments on commit 50f56a2

Please sign in to comment.