1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* insns.def (defined): respond_to_missing? may not be available

(for BasicObject instances).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2010-05-30 17:20:15 +00:00
parent b6e91b9ddf
commit e0ad353fe0
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Mon May 31 02:17:54 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
* insns.def (defined): respond_to_missing? may not be available
(for BasicObject instances).
Mon May 31 01:43:42 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* lib/delegate: Delegator: combine (public|protected) methods with

View file

@ -799,8 +799,15 @@ defined
}
}
}
if (RTEST(rb_funcall(v, rb_intern("respond_to_missing?"), 2, obj, Qfalse)))
expr_type = "method";
{
VALUE args[2];
VALUE r;
args[0] = obj; args[1] = Qfalse;
r = rb_check_funcall(v, rb_intern("respond_to_missing?"), 2, args);
if (r != Qundef && RTEST(r))
expr_type = "method";
}
break;
}
case DEFINED_YIELD: