[前][次][番号順一覧][スレッド一覧]

ruby-changes:53363

From: nagachika <ko1@a...>
Date: Tue, 6 Nov 2018 23:50:05 +0900 (JST)
Subject: [ruby-changes:53363] nagachika:r65579 (ruby_2_5): merge revision(s) 64786: [Backport #15087]

nagachika	2018-11-06 23:49:59 +0900 (Tue, 06 Nov 2018)

  New Revision: 65579

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65579

  Log:
    merge revision(s) 64786: [Backport #15087]
    
    parse.y: fix block passing with empty kwargs
    
    * parse.y (arg_blk_pass): preceeding arguments node may be NULL when
      an empty keyword argument hash splat is optimized away.
      [ruby-core:88890] [Bug #15087]

  Modified directories:
    branches/ruby_2_5/
  Modified files:
    branches/ruby_2_5/parse.y
    branches/ruby_2_5/test/ruby/test_keyword.rb
    branches/ruby_2_5/version.h
Index: ruby_2_5/version.h
===================================================================
--- ruby_2_5/version.h	(revision 65578)
+++ ruby_2_5/version.h	(revision 65579)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1
 #define RUBY_VERSION "2.5.4"
-#define RUBY_RELEASE_DATE "2018-10-21"
-#define RUBY_PATCHLEVEL 107
+#define RUBY_RELEASE_DATE "2018-11-06"
+#define RUBY_PATCHLEVEL 108
 
 #define RUBY_RELEASE_YEAR 2018
-#define RUBY_RELEASE_MONTH 10
-#define RUBY_RELEASE_DAY 21
+#define RUBY_RELEASE_MONTH 11
+#define RUBY_RELEASE_DAY 6
 
 #include "ruby/version.h"
 
Index: ruby_2_5/test/ruby/test_keyword.rb
===================================================================
--- ruby_2_5/test/ruby/test_keyword.rb	(revision 65578)
+++ ruby_2_5/test/ruby/test_keyword.rb	(revision 65579)
@@ -547,7 +547,8 @@ class TestKeywordArguments < Test::Unit: https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_keyword.rb#L547
 
   def test_dynamic_symbol_keyword
     bug10266 = '[ruby-dev:48564] [Bug #10266]'
-    assert_separately(['-', bug10266], <<-'end;') #    do
+    assert_separately(['-', bug10266], "#{<<~"begin;"}\n#{<<~'end;'}")
+    begin;
       bug = ARGV.shift
       "hoge".to_sym
       assert_nothing_raised(bug) {eval("def a(hoge:); end")}
@@ -677,4 +678,8 @@ class TestKeywordArguments < Test::Unit: https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_keyword.rb#L678
       obj.t(42)
     end
   end
+
+  def test_splat_empty_hash_with_block_passing
+    assert_valid_syntax("bug15087(**{}, &nil)")
+  end
 end
Index: ruby_2_5/parse.y
===================================================================
--- ruby_2_5/parse.y	(revision 65578)
+++ ruby_2_5/parse.y	(revision 65579)
@@ -10789,6 +10789,7 @@ static NODE * https://github.com/ruby/ruby/blob/trunk/ruby_2_5/parse.y#L10789
 arg_blk_pass(NODE *node1, NODE *node2)
 {
     if (node2) {
+        if (!node1) return node2;
 	node2->nd_head = node1;
 	nd_set_first_lineno(node2, nd_first_lineno(node1));
 	nd_set_first_column(node2, nd_first_column(node1));
Index: ruby_2_5
===================================================================
--- ruby_2_5	(revision 65578)
+++ ruby_2_5	(revision 65579)

Property changes on: ruby_2_5
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r64786

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]