diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-17 02:04:37 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-17 02:04:37 +0000 |
commit | aaf11f7a47d8e22884593e8beccfe893807b5abd (patch) | |
tree | 774c07686872ca1e9d86d22d0641b9efab9d3bbd /array.c | |
parent | f19e32afacda093d2628190b4e2814a109ad51cd (diff) | |
download | ruby-aaf11f7a47d8e22884593e8beccfe893807b5abd.tar.gz ruby-aaf11f7a47d8e22884593e8beccfe893807b5abd.tar.xz ruby-aaf11f7a47d8e22884593e8beccfe893807b5abd.zip |
* 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
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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]; |