diff --git a/ChangeLog b/ChangeLog index 6d08f388cf..5b1650d59d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Oct 2 01:02:35 2003 Yukihiro Matsumoto + + * variable.c (rb_const_defined_at): should exclude constants from + Object when TYPE(klass) == T_MODULE *and* exclude is on. + [ruby-dev:21458] + + * variable.c (rb_const_get_0): do not lookup constants from Object + when TYPE(klass) == T_MODULE *and* exclude is on. + Thu Oct 2 00:21:11 2003 NAKAMURA, Hiroshi * test/logger/test_logger.rb: unlinking file before close causes diff --git a/variable.c b/variable.c index f2e9c7c98e..05f6281c3d 100644 --- a/variable.c +++ b/variable.c @@ -1286,7 +1286,7 @@ rb_const_get_0(klass, id, exclude, recurse) if (!recurse && klass != rb_cObject) break; tmp = RCLASS(tmp)->super; } - if (!mod_retry && BUILTIN_TYPE(klass) == T_MODULE) { + if (!exclude && !mod_retry && BUILTIN_TYPE(klass) == T_MODULE) { mod_retry = 1; tmp = rb_cObject; goto retry; @@ -1316,7 +1316,7 @@ rb_const_get_at(klass, id) VALUE klass; ID id; { - return rb_const_get_0(klass, id, Qfalse, Qfalse); + return rb_const_get_0(klass, id, Qtrue, Qfalse); } VALUE @@ -1450,20 +1450,12 @@ rb_const_defined_0(klass, id, exclude, recurse) return Qfalse; } -int -rb_const_defined_at(klass, id) - VALUE klass; - ID id; -{ - return rb_const_defined_0(klass, id, Qtrue, Qfalse); -} - int rb_const_defined_from(klass, id) VALUE klass; ID id; { - return rb_const_defined_0(klass, id, Qfalse, Qtrue); + return rb_const_defined_0(klass, id, Qtrue, Qtrue); } int @@ -1471,7 +1463,15 @@ rb_const_defined(klass, id) VALUE klass; ID id; { - return rb_const_defined_0(klass, id, Qtrue, Qtrue); + return rb_const_defined_0(klass, id, Qfalse, Qtrue); +} + +int +rb_const_defined_at(klass, id) + VALUE klass; + ID id; +{ + return rb_const_defined_0(klass, id, Qtrue, Qfalse); } static void