ruby-changes:28999
From: nagachika <ko1@a...>
Date: Mon, 3 Jun 2013 23:57:54 +0900 (JST)
Subject: [ruby-changes:28999] nagachika:r41051 (ruby_2_0_0): merge revision(s) 40807: [Backport #8416]
nagachika 2013-06-03 23:57:36 +0900 (Mon, 03 Jun 2013) New Revision: 41051 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41051 Log: merge revision(s) 40807: [Backport #8416] * compile.c (iseq_compile_each): forward anonymous and first keyword rest argument one. [ruby-core:55033] [Bug #8416]. Modified directories: branches/ruby_2_0_0/ Modified files: branches/ruby_2_0_0/ChangeLog branches/ruby_2_0_0/compile.c branches/ruby_2_0_0/test/ruby/test_keyword.rb branches/ruby_2_0_0/version.h Index: ruby_2_0_0/ChangeLog =================================================================== --- ruby_2_0_0/ChangeLog (revision 41050) +++ ruby_2_0_0/ChangeLog (revision 41051) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1 +Mon Jun 3 23:22:58 2013 Nobuyoshi Nakada <nobu@r...> + + * compile.c (iseq_compile_each): forward anonymous and first keyword + rest argument one. [ruby-core:55033] [Bug #8416]. + Sun Jun 2 22:39:24 2013 Zachary Scott <zachary@z...> * range.c: Fix rdoc on Range#bsearch [Bug #8242] [ruby-core:54143] Index: ruby_2_0_0/compile.c =================================================================== --- ruby_2_0_0/compile.c (revision 41050) +++ ruby_2_0_0/compile.c (revision 41051) @@ -4471,7 +4471,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/compile.c#L4471 } } - if (liseq->arg_keyword > 0) { + if (liseq->arg_keyword >= 0) { int local_size = liseq->local_size; int idx = local_size - liseq->arg_keyword; argc++; Index: ruby_2_0_0/version.h =================================================================== --- ruby_2_0_0/version.h (revision 41050) +++ ruby_2_0_0/version.h (revision 41051) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1 #define RUBY_VERSION "2.0.0" -#define RUBY_RELEASE_DATE "2013-06-02" -#define RUBY_PATCHLEVEL 198 +#define RUBY_RELEASE_DATE "2013-06-03" +#define RUBY_PATCHLEVEL 199 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 6 -#define RUBY_RELEASE_DAY 2 +#define RUBY_RELEASE_DAY 3 #include "ruby/version.h" Index: ruby_2_0_0/test/ruby/test_keyword.rb =================================================================== --- ruby_2_0_0/test/ruby/test_keyword.rb (revision 41050) +++ ruby_2_0_0/test/ruby/test_keyword.rb (revision 41051) @@ -312,4 +312,34 @@ class TestKeywordArguments < Test::Unit: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_keyword.rb#L312 assert_equal([42, {:bar=>"x"}], a.new.foo(42), bug8236) assert_equal([42, {:bar=>"x"}], b.new.foo(42), bug8236) end + + def test_zsuper_only_named_kwrest + bug8416 = '[ruby-core:55033] [Bug #8416]' + base = Class.new do + def foo(**h) + h + end + end + a = Class.new(base) do + def foo(**h) + super + end + end + assert_equal({:bar=>"x"}, a.new.foo(bar: "x"), bug8416) + end + + def test_zsuper_only_anonymous_kwrest + bug8416 = '[ruby-core:55033] [Bug #8416]' + base = Class.new do + def foo(**h) + h + end + end + a = Class.new(base) do + def foo(**) + super + end + end + assert_equal({:bar=>"x"}, a.new.foo(bar: "x"), bug8416) + end end Property changes on: ruby_2_0_0 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r40807 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/