[前][次][番号順一覧][スレッド一覧]

ruby-changes:13752

From: yugui <ko1@a...>
Date: Thu, 29 Oct 2009 01:11:44 +0900 (JST)
Subject: [ruby-changes:13752] Ruby:r25547 (ruby_1_9_1): merges r24684 from trunk into ruby_1_9_1.

yugui	2009-10-29 01:11:27 +0900 (Thu, 29 Oct 2009)

  New Revision: 25547

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25547

  Log:
    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.

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/include/ruby/intern.h
    branches/ruby_1_9_1/numeric.c
    branches/ruby_1_9_1/test/ruby/test_numeric.rb
    branches/ruby_1_9_1/version.h
    branches/ruby_1_9_1/vm_method.c

Index: ruby_1_9_1/include/ruby/intern.h
===================================================================
--- ruby_1_9_1/include/ruby/intern.h	(revision 25546)
+++ ruby_1_9_1/include/ruby/intern.h	(revision 25547)
@@ -259,6 +259,7 @@
 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
Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 25546)
+++ ruby_1_9_1/ChangeLog	(revision 25547)
@@ -1,3 +1,9 @@
+Thu Aug 27 18:31:07 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* ext/strscan/strscan.c (strscan_set_string): set string should not be
Index: ruby_1_9_1/vm_method.c
===================================================================
--- ruby_1_9_1/vm_method.c	(revision 25546)
+++ ruby_1_9_1/vm_method.c	(revision 25547)
@@ -301,8 +301,8 @@
     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 @@
     }
 }
 
+#define remove_method(klass, mid) rb_remove_method_id(klass, mid)
+
 void
 rb_remove_method(VALUE klass, const char *name)
 {
Index: ruby_1_9_1/numeric.c
===================================================================
--- ruby_1_9_1/numeric.c	(revision 25546)
+++ ruby_1_9_1/numeric.c	(revision 25547)
@@ -202,13 +202,13 @@
 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 */
 }
Index: ruby_1_9_1/version.h
===================================================================
--- ruby_1_9_1/version.h	(revision 25546)
+++ ruby_1_9_1/version.h	(revision 25547)
@@ -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
Index: ruby_1_9_1/test/ruby/test_numeric.rb
===================================================================
--- ruby_1_9_1/test/ruby/test_numeric.rb	(revision 25546)
+++ ruby_1_9_1/test/ruby/test_numeric.rb	(revision 25547)
@@ -47,6 +47,7 @@
   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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]