mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									0e0e4cb4cc
								
							
						
					
					
						commit
						2110125b43
					
				
					 4 changed files with 14 additions and 2 deletions
				
			
		| 
						 | 
					@ -1,3 +1,8 @@
 | 
				
			||||||
 | 
					Tue Mar 29 21:03:40 2016  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* 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@ruby-lang.org>
 | 
					Tue Mar 29 21:01:07 2016  SHIBATA Hiroshi  <hsbt@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* doc/syntax/calling_methods.rdoc: fix old operator for safe navigation
 | 
						* doc/syntax/calling_methods.rdoc: fix old operator for safe navigation
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								symbol.h
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								symbol.h
									
										
									
									
									
								
							| 
						 | 
					@ -36,7 +36,7 @@ struct RSymbol {
 | 
				
			||||||
#define is_local_id(id) (id_type(id)==ID_LOCAL)
 | 
					#define is_local_id(id) (id_type(id)==ID_LOCAL)
 | 
				
			||||||
#define is_global_id(id) (id_type(id)==ID_GLOBAL)
 | 
					#define is_global_id(id) (id_type(id)==ID_GLOBAL)
 | 
				
			||||||
#define is_instance_id(id) (id_type(id)==ID_INSTANCE)
 | 
					#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_const_id(id) (id_type(id)==ID_CONST)
 | 
				
			||||||
#define is_class_id(id) (id_type(id)==ID_CLASS)
 | 
					#define is_class_id(id) (id_type(id)==ID_CLASS)
 | 
				
			||||||
#define is_junk_id(id) (id_type(id)==ID_JUNK)
 | 
					#define is_junk_id(id) (id_type(id)==ID_JUNK)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -83,4 +83,11 @@ class TestCall < Test::Unit::TestCase
 | 
				
			||||||
  def test_safe_call_block_call_command
 | 
					  def test_safe_call_block_call_command
 | 
				
			||||||
    assert_nil(("a".sub! "b" do end&.foo 1 do end))
 | 
					    assert_nil(("a".sub! "b" do end&.foo 1 do end))
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def test_invalid_safe_call
 | 
				
			||||||
 | 
					    h = nil
 | 
				
			||||||
 | 
					    assert_raise(NoMethodError) {
 | 
				
			||||||
 | 
					      h[:foo] = nil
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
#define RUBY_VERSION "2.3.0"
 | 
					#define RUBY_VERSION "2.3.0"
 | 
				
			||||||
#define RUBY_RELEASE_DATE "2016-03-29"
 | 
					#define RUBY_RELEASE_DATE "2016-03-29"
 | 
				
			||||||
#define RUBY_PATCHLEVEL 46
 | 
					#define RUBY_PATCHLEVEL 47
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define RUBY_RELEASE_YEAR 2016
 | 
					#define RUBY_RELEASE_YEAR 2016
 | 
				
			||||||
#define RUBY_RELEASE_MONTH 3
 | 
					#define RUBY_RELEASE_MONTH 3
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue