1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 1999-11-29 06:33:02 +00:00
parent 2b49047143
commit 40517ecac8
7 changed files with 61 additions and 13 deletions

View file

@ -195,10 +195,20 @@ VALUE
rb_path2class(path)
const char *path;
{
VALUE c;
if (path[0] == '#') {
rb_raise(rb_eArgError, "can't retrieve anonymous class %s", path);
}
return rb_eval_string(path);
c = rb_eval_string(path);
switch (TYPE(c)) {
case T_MODULE:
case T_CLASS:
break;
default:
rb_raise(rb_eTypeError, "class path %s does not point class", path);
}
return c;
}
void