eval.c: clear cache
* eval.c (rb_using_module): clear method cache after applying refinements. * eval.c (mod_using, top_using): remove redundant type checks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b07bdbc2b3
commit
4547d773c2
5
eval.c
5
eval.c
@ -1176,6 +1176,7 @@ rb_using_module(NODE *cref, VALUE module)
|
||||
{
|
||||
Check_Type(module, T_MODULE);
|
||||
using_module_recursive(cref, module);
|
||||
rb_clear_method_cache_by_class(rb_cObject);
|
||||
}
|
||||
|
||||
VALUE
|
||||
@ -1295,9 +1296,7 @@ mod_using(VALUE self, VALUE module)
|
||||
if (prev_cfp && prev_cfp->self != self) {
|
||||
rb_raise(rb_eRuntimeError, "Module#using is not called on self");
|
||||
}
|
||||
Check_Type(module, T_MODULE);
|
||||
rb_using_module(cref, module);
|
||||
rb_clear_method_cache_by_class(rb_cObject);
|
||||
return self;
|
||||
}
|
||||
|
||||
@ -1431,9 +1430,7 @@ top_using(VALUE self, VALUE module)
|
||||
rb_raise(rb_eRuntimeError,
|
||||
"main.using is permitted only at toplevel");
|
||||
}
|
||||
Check_Type(module, T_MODULE);
|
||||
rb_using_module(cref, module);
|
||||
rb_clear_method_cache_by_class(rb_cObject);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user