diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-08-23 06:00:31 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-08-23 06:00:31 +0000 |
commit | 91866217e79574e43e130a462db25a81a976ef61 (patch) | |
tree | bcfdbd826fa9bed6a84553f28d9d67370faa6758 /eval.c | |
parent | 3b0216fd901c61f278f5cf46a0f14f86d1f0151f (diff) |
* eval.c (is_defined): should not dump core for "defined?(())".
* eval.c (umethod_bind): recv can be an instance of descender of
oklass if oklass is a Module.
* hash.c (rb_hash_equal): check identiry equality first.
* variable.c (mod_av_set): detect constant overriding for built-in
classes/modules.
* marshal.c (w_object): should retrieve __member__ data from
non-singleton class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1718,6 +1718,7 @@ is_defined(self, node, buf) VALUE val; /* OK */ int state; + if (!node) return "expression"; switch (nd_type(node)) { case NODE_SUPER: case NODE_ZSUPER: @@ -6693,8 +6694,10 @@ umethod_bind(method, recv) st_lookup(RCLASS(CLASS_OF(recv))->m_tbl, data->oid, 0)) { rb_raise(rb_eTypeError, "method `%s' overridden", rb_id2name(data->oid)); } - if (!rb_obj_is_instance_of(recv, data->oklass)) { - rb_raise(rb_eTypeError, "first argument must be an instance of %s", + if (!((TYPE(data->oklass) == T_MODULE) ? + rb_obj_is_kind_of(recv, data->oklass) : + rb_obj_is_instance_of(recv, data->oklass))) { + rb_raise(rb_eTypeError, "bind argument must be an instance of %s", rb_class2name(data->oklass)); } } |