diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-28 06:24:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-28 06:24:12 +0000 |
commit | 72ff61f4a8ae7a8bf05b0bd6f91b3b290645627c (patch) | |
tree | 731069832b17cffaafc9fdcdd394f1976c7ec576 /vm_method.c | |
parent | 7a929727f6a4e45a0ebf0542650ff122b16264ad (diff) |
NameError#receiver of uninitialized constant
* error.c (name_err_mesg_to_str): quote the name if unprintable.
* object.c (check_setter_id): use rb_check_id to convert names.
* variable.c (uninitialized_constant): use NameError::message to
keep the receiver of uninitialized constant. [Feature #10881]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vm_method.c b/vm_method.c index f61c1b7d96..4059312953 100644 --- a/vm_method.c +++ b/vm_method.c @@ -918,8 +918,8 @@ remove_method(VALUE klass, ID mid) !(me = (rb_method_entry_t *)data) || (!me->def || me->def->type == VM_METHOD_TYPE_UNDEF) || UNDEFINED_REFINED_METHOD_P(me->def)) { - rb_name_error(mid, "method `%"PRIsVALUE"' not defined in %"PRIsVALUE, - rb_id2str(mid), rb_class_path(klass)); + rb_name_err_raise("method `%1$s' not defined in %2$s", + klass, ID2SYM(mid)); } rb_id_table_delete(RCLASS_M_TBL(klass), mid); @@ -965,8 +965,8 @@ rb_mod_remove_method(int argc, VALUE *argv, VALUE mod) VALUE v = argv[i]; ID id = rb_check_id(&v); if (!id) { - rb_name_error_str(v, "method `%"PRIsVALUE"' not defined in %"PRIsVALUE, - v, rb_obj_class(mod)); + rb_name_err_raise("method `%1$s' not defined in %2$s", + mod, v); } remove_method(mod, id); } |