summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-07 19:18:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-07 19:18:16 +0000
commit54fdacb12545f40e83b013e7c8207fb5416b1403 (patch)
treea78adc8cdeb42f4a59788e2e5dda13627a130446 /eval.c
parent8e3721dfa828464981b5e9f77eff79b815c288d5 (diff)
* class.c (rb_define_method): do not set NOEX_CFUNC if klass is
really a module, whose methods must be safe for reciever's type. * eval.c (rb_eval): nosuper should not be inherited unless the overwritten method is an undef placeholder. * parse.y (primary): allow 'when'-less case statement; persuaded by Sean Chittenden. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 6a7254587e..75f70b8a81 100644
--- a/eval.c
+++ b/eval.c
@@ -384,7 +384,7 @@ rb_disable_super(klass, name)
print_undef(klass, mid);
}
if (origin == klass) {
- body->nd_noex |= NOEX_UNDEF;
+ body->nd_noex |= NOEX_NOSUPER;
}
else {
rb_add_method(klass, mid, 0, NOEX_UNDEF);
@@ -408,7 +408,7 @@ rb_enable_super(klass, name)
remove_method(klass, mid);
}
else {
- body->nd_noex &= ~NOEX_UNDEF;
+ body->nd_noex &= ~NOEX_NOSUPER;
}
}
@@ -3204,8 +3204,8 @@ rb_eval(self, n)
else {
noex = NOEX_PUBLIC;
}
- if (body && origin == ruby_class && body->nd_noex & NOEX_UNDEF) {
- noex |= NOEX_UNDEF;
+ if (body && origin == ruby_class && body->nd_body == 0) {
+ noex |= NOEX_NOSUPER;
}
defn = copy_node_scope(node->nd_defn, ruby_cref);
@@ -4807,7 +4807,7 @@ rb_call(klass, recv, mid, argc, argv, scope)
}
}
- return rb_call0(klass, recv, mid, id, argc, argv, body, noex & NOEX_UNDEF);
+ return rb_call0(klass, recv, mid, id, argc, argv, body, noex & NOEX_NOSUPER);
}
VALUE