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

ruby-changes:35157

From: nobu <ko1@a...>
Date: Thu, 21 Aug 2014 13:39:52 +0900 (JST)
Subject: [ruby-changes:35157] nobu:r47239 (trunk): compar.c: use Module#to_s

nobu	2014-08-21 13:39:32 +0900 (Thu, 21 Aug 2014)

  New Revision: 47239

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

  Log:
    compar.c: use Module#to_s
    
    * compar.c (rb_cmperr): use Module#to_s so that names in a message
      can be overridden by to_s.

  Modified files:
    trunk/compar.c
    trunk/test/ruby/test_comparable.rb
Index: compar.c
===================================================================
--- compar.c	(revision 47238)
+++ compar.c	(revision 47239)
@@ -24,10 +24,10 @@ rb_cmperr(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/compar.c#L24
 	classname = rb_inspect(y);
     }
     else {
-	classname = rb_class_path(rb_obj_class(y));
+	classname = rb_obj_class(y);
     }
     rb_raise(rb_eArgError, "comparison of %"PRIsVALUE" with %"PRIsVALUE" failed",
-	     rb_class_path(rb_obj_class(x)), classname);
+	     rb_obj_class(x), classname);
 }
 
 static VALUE
Index: test/ruby/test_comparable.rb
===================================================================
--- test/ruby/test_comparable.rb	(revision 47238)
+++ test/ruby/test_comparable.rb	(revision 47239)
@@ -73,7 +73,7 @@ class TestComparable < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/ruby/test_comparable.rb#L73
   def test_err
     assert_raise(ArgumentError) { 1.0 < nil }
     assert_raise(ArgumentError) { 1.0 < Object.new }
-    e = Module.new {break module_eval("class E\u{30a8 30e9 30fc}; self; end")}
+    e = EnvUtil.labeled_class("E\u{30a8 30e9 30fc}")
     assert_raise_with_message(ArgumentError, /E\u{30a8 30e9 30fc}/) {
       1.0 < e.new
     }

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

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