1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merges r24684 from trunk into ruby_1_9_1.

--
* 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/branches/ruby_1_9_1@25547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2009-10-28 16:11:27 +00:00
parent 3750847f55
commit 3c0e4e61d6
6 changed files with 16 additions and 6 deletions

View file

@ -1,3 +1,9 @@
Thu Aug 27 18:31:07 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_method.c (rb_remove_method_id): exported.
* numeric.c (num_sadded): fix for non-ascii method name.
Thu Aug 27 08:16:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/strscan/strscan.c (strscan_set_string): set string should not be

View file

@ -259,6 +259,7 @@ NORETURN(void rb_exc_fatal(VALUE));
VALUE rb_f_exit(int,VALUE*);
VALUE rb_f_abort(int,VALUE*);
void rb_remove_method(VALUE, const char*);
void rb_remove_method_id(VALUE, ID);
#define rb_disable_super(klass, name) ((void)0)
#define rb_enable_super(klass, name) ((void)0)
#define HAVE_RB_DEFINE_ALLOC_FUNC 1

View file

@ -202,13 +202,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 */
}

View file

@ -47,6 +47,7 @@ class TestNumeric < Test::Unit::TestCase
def test_numeric
a = Numeric.new
assert_raise(TypeError) { def a.foo; end }
assert_raise(TypeError) { eval("def a.\u3042; end") }
assert_raise(TypeError) { a.dup }
end

View file

@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.1"
#define RUBY_PATCHLEVEL 305
#define RUBY_PATCHLEVEL 306
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1

View file

@ -301,8 +301,8 @@ rb_method_node(VALUE klass, ID id)
return rb_get_method_body(klass, id, 0);
}
static void
remove_method(VALUE klass, ID mid)
void
rb_remove_method_id(VALUE klass, ID mid)
{
st_data_t data;
NODE *body = 0;
@ -344,6 +344,8 @@ remove_method(VALUE klass, ID mid)
}
}
#define remove_method(klass, mid) rb_remove_method_id(klass, mid)
void
rb_remove_method(VALUE klass, const char *name)
{