mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* variable.c (rb_mod_class_variables): class variables are no longer
inherited. [ruby-dev:23808] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									11fa3bf8c7
								
							
						
					
					
						commit
						d4ae605240
					
				
					 2 changed files with 9 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,8 @@
 | 
			
		|||
Sat Jun 26 15:17:11 2004  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* variable.c (rb_mod_class_variables): class variables are no longer
 | 
			
		||||
	  inherited.  [ruby-dev:23808]
 | 
			
		||||
 | 
			
		||||
Sat Jun 26 11:07:20 2004  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in (aix): -b must come at the start of the command line,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										13
									
								
								variable.c
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								variable.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1800,8 +1800,7 @@ cv_i(key, value, ary)
 | 
			
		|||
 *  call-seq:
 | 
			
		||||
 *     mod.class_variables   => array
 | 
			
		||||
 *  
 | 
			
		||||
 *  Returns an array of the names of class variables in <i>mod</i> and
 | 
			
		||||
 *  the ancestors of <i>mod</i>.
 | 
			
		||||
 *  Returns an array of the names of class variables in <i>mod</i>.
 | 
			
		||||
 *     
 | 
			
		||||
 *     class One
 | 
			
		||||
 *       @@var1 = 1
 | 
			
		||||
| 
						 | 
				
			
			@ -1810,7 +1809,7 @@ cv_i(key, value, ary)
 | 
			
		|||
 *       @@var2 = 2
 | 
			
		||||
 *     end
 | 
			
		||||
 *     One.class_variables   #=> ["@@var1"]
 | 
			
		||||
 *     Two.class_variables   #=> ["@@var2", "@@var1"]
 | 
			
		||||
 *     Two.class_variables   #=> ["@@var2"]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
VALUE
 | 
			
		||||
| 
						 | 
				
			
			@ -1819,12 +1818,8 @@ rb_mod_class_variables(obj)
 | 
			
		|||
{
 | 
			
		||||
    VALUE ary = rb_ary_new();
 | 
			
		||||
 | 
			
		||||
    for (;;) {
 | 
			
		||||
	if (RCLASS(obj)->iv_tbl) {
 | 
			
		||||
	    st_foreach(RCLASS(obj)->iv_tbl, cv_i, ary);
 | 
			
		||||
	}
 | 
			
		||||
	obj = RCLASS(obj)->super;
 | 
			
		||||
	if (!obj) break;
 | 
			
		||||
    if (RCLASS(obj)->iv_tbl) {
 | 
			
		||||
	st_foreach(RCLASS(obj)->iv_tbl, cv_i, ary);
 | 
			
		||||
    }
 | 
			
		||||
    return ary;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue