mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
19991129
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2b49047143
commit
40517ecac8
7 changed files with 61 additions and 13 deletions
12
variable.c
12
variable.c
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue