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

ruby-changes:42322

From: naruse <ko1@a...>
Date: Tue, 29 Mar 2016 21:11:48 +0900 (JST)
Subject: [ruby-changes:42322] naruse:r54396 (ruby_2_3): merge revision(s) 53485: [Backport #11976]

naruse	2016-03-29 21:11:41 +0900 (Tue, 29 Mar 2016)

  New Revision: 54396

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

  Log:
    merge revision(s) 53485: [Backport #11976]
    
    * symbol.h (is_attrset_id): ASET is an attrset ID.  fix
      unexpected safe call instead of an ordinary ASET.

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/symbol.h
    branches/ruby_2_3/test/ruby/test_call.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 54395)
+++ ruby_2_3/version.h	(revision 54396)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.0"
 #define RUBY_RELEASE_DATE "2016-03-29"
-#define RUBY_PATCHLEVEL 46
+#define RUBY_PATCHLEVEL 47
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_3/symbol.h
===================================================================
--- ruby_2_3/symbol.h	(revision 54395)
+++ ruby_2_3/symbol.h	(revision 54396)
@@ -36,7 +36,7 @@ struct RSymbol { https://github.com/ruby/ruby/blob/trunk/ruby_2_3/symbol.h#L36
 #define is_local_id(id) (id_type(id)==ID_LOCAL)
 #define is_global_id(id) (id_type(id)==ID_GLOBAL)
 #define is_instance_id(id) (id_type(id)==ID_INSTANCE)
-#define is_attrset_id(id) (id_type(id)==ID_ATTRSET)
+#define is_attrset_id(id) ((id)==idASET||id_type(id)==ID_ATTRSET)
 #define is_const_id(id) (id_type(id)==ID_CONST)
 #define is_class_id(id) (id_type(id)==ID_CLASS)
 #define is_junk_id(id) (id_type(id)==ID_JUNK)
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 54395)
+++ ruby_2_3/ChangeLog	(revision 54396)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Tue Mar 29 21:03:40 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* symbol.h (is_attrset_id): ASET is an attrset ID.  fix
+	  unexpected safe call instead of an ordinary ASET.
+
 Tue Mar 29 21:01:07 2016  SHIBATA Hiroshi  <hsbt@r...>
 
 	* doc/syntax/calling_methods.rdoc: fix old operator for safe navigation
Index: ruby_2_3/test/ruby/test_call.rb
===================================================================
--- ruby_2_3/test/ruby/test_call.rb	(revision 54395)
+++ ruby_2_3/test/ruby/test_call.rb	(revision 54396)
@@ -83,4 +83,11 @@ class TestCall < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_call.rb#L83
   def test_safe_call_block_call_command
     assert_nil(("a".sub! "b" do end&.foo 1 do end))
   end
+
+  def test_invalid_safe_call
+    h = nil
+    assert_raise(NoMethodError) {
+      h[:foo] = nil
+    }
+  end
 end

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r53485


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

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