From aaf11f7a47d8e22884593e8beccfe893807b5abd Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 17 Jul 2009 02:04:37 +0000 Subject: * array.c (recursive_join): raise ArgumentError for joining recursive array. * array.c (ary_join_1): ditto. * test/ruby/test_array.rb (TestArray#test_join2): test updated for recursive join. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index b9b60c873..d8f787c02 100644 --- a/array.c +++ b/array.c @@ -1530,7 +1530,7 @@ recursive_join(VALUE obj, VALUE argp, int recur) VALUE result = arg[2]; if (recur) { - rb_str_buf_cat_ascii(result, "[...]"); + rb_raise(rb_eArgError, "recursive array join"); } else { ary_join_1(obj, ary, sep, 0, result); @@ -1573,8 +1573,7 @@ ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result) obj = val; ary_join: if (val == ary) { - val = rb_usascii_str_new2("[...]"); - goto str_join; + rb_raise(rb_eArgError, "recursive array join"); } else { VALUE args[3]; -- cgit