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

* variable.c (rb_autoload_load): should delete autoloaded

symbol itself before load.  [ruby-core:01097]

* variable.c (rb_mod_remove_const): must not return Qundef.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-05-29 21:21:23 +00:00
parent e617fd0bf8
commit f130d47f6a
2 changed files with 22 additions and 2 deletions

View file

@ -1,3 +1,10 @@
Fri May 30 06:21:18 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* variable.c (rb_autoload_load): should delete autoloaded
symbol itself before load. [ruby-core:01097]
* variable.c (rb_mod_remove_const): must not return Qundef.
Thu May 29 14:59:10 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* win32/win32.c (_CRTIMP): redefine _CRTIMP on MinGW.

View file

@ -1112,7 +1112,7 @@ uninitialized_constant(klass, id)
RSTRING(rb_class_path(klass))->ptr,
rb_id2name(id));
else {
rb_name_error(id, "uninitialized constant %s",rb_id2name(id));
rb_name_error(id, "uninitialized constant %s", rb_id2name(id));
}
}
@ -1194,7 +1194,17 @@ rb_autoload_load(klass, id)
ID id;
{
VALUE file, value;
ID tmp = id;
if (!st_delete(RCLASS(klass)->iv_tbl, &tmp, &value) || value != Qundef) {
if (klass != rb_cObject)
rb_name_error(id, "not autoload constant %s::%s",
RSTRING(rb_class_path(klass))->ptr,
rb_id2name(id));
else {
rb_name_error(id, "not autoload constant %s", rb_id2name(id));
}
}
file = autoload_delete(klass, id);
if (NIL_P(file)) {
uninitialized_constant(klass, id);
@ -1330,7 +1340,10 @@ rb_mod_remove_const(mod, name)
if (OBJ_FROZEN(mod)) rb_error_frozen("class/module");
if (RCLASS(mod)->iv_tbl && st_delete(ROBJECT(mod)->iv_tbl, &id, &val)) {
if (val == Qundef) autoload_delete(mod, id);
if (val == Qundef) {
autoload_delete(mod, id);
val = Qnil;
}
return val;
}
if (rb_const_defined_at(mod, id)) {