* vm_method.c (rb_remove_method_id): exported.

* numeric.c (num_sadded): fix for non-ascii method name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-08-27 09:31:11 +00:00
parent a20bd463a8
commit 84255e0485
5 changed files with 19 additions and 7 deletions

View file

@ -203,13 +203,13 @@ rb_num_coerce_relop(VALUE x, VALUE y, ID func)
static VALUE
num_sadded(VALUE x, VALUE name)
{
const char *nstr = rb_id2name(rb_to_id(name));
ID mid = rb_to_id(name);
/* ruby_frame = ruby_frame->prev; */ /* pop frame for "singleton_method_added" */
/* Numerics should be values; singleton_methods should not be added to them */
rb_remove_method(rb_singleton_class(x), nstr);
rb_remove_method_id(rb_singleton_class(x), mid);
rb_raise(rb_eTypeError,
"can't define singleton method \"%s\" for %s",
nstr,
rb_id2name(mid),
rb_obj_classname(x));
return Qnil; /* not reached */
}