From 4b1b5048b9ddeaba12aa429d3da73f4834b75ecb Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 26 Jun 2004 06:17:20 +0000 Subject: * variable.c (rb_mod_class_variables): class variables are no longer inherited. [ruby-dev:23808] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ variable.c | 13 ++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39d7fc4f4..2924e8c54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Jun 26 15:17:11 2004 Nobuyoshi Nakada + + * variable.c (rb_mod_class_variables): class variables are no longer + inherited. [ruby-dev:23808] + Sat Jun 26 11:07:20 2004 Nobuyoshi Nakada * configure.in (aix): -b must come at the start of the command line, diff --git a/variable.c b/variable.c index cb972ba81..6d4ccd2c5 100644 --- a/variable.c +++ b/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 mod and - * the ancestors of mod. + * Returns an array of the names of class variables in mod. * * 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; } -- cgit