aboutsummaryrefslogtreecommitdiffstats
path: root/vm_method.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-27 13:57:14 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-27 13:57:14 +0000
commit3b8469723a7ba84eab723611d022dd4f70f3384d (patch)
treebae564eefcc17851d370372f3c25a838040fe3dc /vm_method.c
parentfeb3f1546d540aab60a785811b54a2a50f7759fe (diff)
downloadruby-3b8469723a7ba84eab723611d022dd4f70f3384d.tar.gz
eval.c: rename "rb_frozen_class_p" to "rb_class_modify_check"
Just refactoring. Despite its name, the function does NOT return a boolean but raises an exception when the class given is frozen. I don't think the new name "rb_class_modify_check" is the best, but it follows the precedeint "rb_ary_modify_check", and is definitely better than "*_p". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vm_method.c b/vm_method.c
index 520d41f36b..7a06e39505 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -539,7 +539,7 @@ rb_method_entry_make(VALUE klass, ID mid, VALUE defined_class, rb_method_visibil
}
}
- rb_frozen_class_p(klass);
+ rb_class_modify_check(klass);
if (FL_TEST(klass, RMODULE_IS_REFINEMENT)) {
VALUE refined_class = rb_refinement_module_get_refined_class(klass);
@@ -985,7 +985,7 @@ remove_method(VALUE klass, ID mid)
VALUE self = klass;
klass = RCLASS_ORIGIN(klass);
- rb_frozen_class_p(klass);
+ rb_class_modify_check(klass);
if (mid == object_id || mid == id__send__ || mid == idInitialize) {
rb_warn("removing `%s' may cause serious problems", rb_id2name(mid));
}
@@ -1198,7 +1198,7 @@ rb_undef(VALUE klass, ID id)
if (NIL_P(klass)) {
rb_raise(rb_eTypeError, "no class to undef method");
}
- rb_frozen_class_p(klass);
+ rb_class_modify_check(klass);
if (id == object_id || id == id__send__ || id == idInitialize) {
rb_warn("undefining `%s' may cause serious problems", rb_id2name(id));
}
@@ -1555,7 +1555,7 @@ rb_alias(VALUE klass, ID alias_name, ID original_name)
rb_raise(rb_eTypeError, "no class to make alias");
}
- rb_frozen_class_p(klass);
+ rb_class_modify_check(klass);
again:
orig_me = search_method(klass, original_name, &defined_class);