ruby-changes:47123
From: usa <ko1@a...>
Date: Fri, 30 Jun 2017 21:54:54 +0900 (JST)
Subject: [ruby-changes:47123] usa:r59238 (ruby_2_3): merge revision(s) 58693: [Backport #13558]
usa 2017-06-30 21:54:50 +0900 (Fri, 30 Jun 2017) New Revision: 59238 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59238 Log: merge revision(s) 58693: [Backport #13558] array.c: check position to insert * array.c (rb_ary_insert): check position to insert even if no elements to be inserted. [ruby-core:81125] [Bug #13558] Modified directories: branches/ruby_2_3/ Modified files: branches/ruby_2_3/ChangeLog branches/ruby_2_3/array.c branches/ruby_2_3/test/ruby/test_array.rb branches/ruby_2_3/version.h Index: ruby_2_3/version.h =================================================================== --- ruby_2_3/version.h (revision 59237) +++ ruby_2_3/version.h (revision 59238) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1 #define RUBY_VERSION "2.3.5" #define RUBY_RELEASE_DATE "2017-06-30" -#define RUBY_PATCHLEVEL 334 +#define RUBY_PATCHLEVEL 335 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 6 Index: ruby_2_3/test/ruby/test_array.rb =================================================================== --- ruby_2_3/test/ruby/test_array.rb (revision 59237) +++ ruby_2_3/test/ruby/test_array.rb (revision 59238) @@ -2063,6 +2063,7 @@ class TestArray < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_array.rb#L2063 assert_equal([0], a.insert(1)) assert_equal([0, 1], a.insert(1, 1)) assert_raise(ArgumentError) { a.insert } + assert_raise(TypeError) { a.insert(Object.new) } assert_equal([0, 1, 2], a.insert(-1, 2)) assert_equal([0, 1, 3, 2], a.insert(-2, 3)) assert_raise(RuntimeError) { [0].freeze.insert(0)} Index: ruby_2_3/ChangeLog =================================================================== --- ruby_2_3/ChangeLog (revision 59237) +++ ruby_2_3/ChangeLog (revision 59238) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1 +Fri Jun 30 21:54:01 2017 Nobuyoshi Nakada <nobu@r...> + + * array.c (rb_ary_insert): check position to insert even if no elements + to be inserted. [Bug #13558] + Fri Jun 30 21:51:40 2017 Marcus Stollsteimer <sto.mar@w...> * ext/date/date_core.c: [DOC] fix documentation for %Z format of Index: ruby_2_3/array.c =================================================================== --- ruby_2_3/array.c (revision 59237) +++ ruby_2_3/array.c (revision 59238) @@ -1766,8 +1766,8 @@ rb_ary_insert(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/ruby_2_3/array.c#L1766 rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS); rb_ary_modify_check(ary); - if (argc == 1) return ary; pos = NUM2LONG(argv[0]); + if (argc == 1) return ary; if (pos == -1) { pos = RARRAY_LEN(ary); } Index: ruby_2_3 =================================================================== --- ruby_2_3 (revision 59237) +++ ruby_2_3 (revision 59238) Property changes on: ruby_2_3 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r58693 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/