summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-01 16:06:19 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-01 16:06:19 +0000
commitf5a7147634b1369a8c0bc79d2d46e4a8285804a0 (patch)
tree4abb70481342f0225155523c39d97ccd8c035981 /variable.c
parent637af54751be6cae06f9cafda9e6ba50b76c61eb (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/variable.c b/variable.c
index f2e9c7c..05f6281 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
@@ -1451,15 +1451,15 @@ rb_const_defined_0(klass, id, exclude, recurse)
}
int
-rb_const_defined_at(klass, id)
+rb_const_defined_from(klass, id)
VALUE klass;
ID id;
{
- return rb_const_defined_0(klass, id, Qtrue, Qfalse);
+ return rb_const_defined_0(klass, id, Qtrue, Qtrue);
}
int
-rb_const_defined_from(klass, id)
+rb_const_defined(klass, id)
VALUE klass;
ID id;
{
@@ -1467,11 +1467,11 @@ rb_const_defined_from(klass, id)
}
int
-rb_const_defined(klass, id)
+rb_const_defined_at(klass, id)
VALUE klass;
ID id;
{
- return rb_const_defined_0(klass, id, Qtrue, Qtrue);
+ return rb_const_defined_0(klass, id, Qtrue, Qfalse);
}
static void