summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 03:53:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 03:53:20 +0000
commit4547d773c2ea02864df5658a99d18718626e902d (patch)
tree96d78a439c5be68f41236a55e5723f1fada9be74 /eval.c
parentb07bdbc2b308440fc1cc3f185256bf9f8433e09a (diff)
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
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index 141cbe1..c92d05d 100644
--- a/eval.c
+++ b/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;
}