summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-05 04:15:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-05 04:15:50 +0000
commit1ec2805c4f79e741d5be8ec0d74b93585179d0be (patch)
tree723d91e6b793403002afcb8386d0d3dc3477eebb /eval.c
parentc7b20263a2f49de507a8009ba8490fdbfe634d1f (diff)
* eval.c (rb_eval): overriding false constant with class/module
definition should be error. (PR#327) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index 25ce389..9d45c54 100644
--- a/eval.c
+++ b/eval.c
@@ -3299,14 +3299,11 @@ rb_eval(self, n)
super = 0;
}
- klass = 0;
if ((ruby_class == rb_cObject) && rb_autoload_defined(node->nd_cname)) {
rb_autoload_load(node->nd_cname);
}
if (rb_const_defined_at(ruby_class, node->nd_cname)) {
klass = rb_const_get(ruby_class, node->nd_cname);
- }
- if (klass) {
if (TYPE(klass) != T_CLASS) {
rb_raise(rb_eTypeError, "%s is not a class",
rb_id2name(node->nd_cname));
@@ -3345,14 +3342,11 @@ rb_eval(self, n)
if (NIL_P(ruby_class)) {
rb_raise(rb_eTypeError, "no outer class/module");
}
- module = 0;
if ((ruby_class == rb_cObject) && rb_autoload_defined(node->nd_cname)) {
rb_autoload_load(node->nd_cname);
}
if (rb_const_defined_at(ruby_class, node->nd_cname)) {
module = rb_const_get(ruby_class, node->nd_cname);
- }
- if (module) {
if (TYPE(module) != T_MODULE) {
rb_raise(rb_eTypeError, "%s is not a module",
rb_id2name(node->nd_cname));