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

ruby-changes:33384

From: nobu <ko1@a...>
Date: Fri, 28 Mar 2014 19:32:52 +0900 (JST)
Subject: [ruby-changes:33384] nobu:r45463 (trunk): struct.c: encoding of member name

nobu	2014-03-28 19:32:36 +0900 (Fri, 28 Mar 2014)

  New Revision: 45463

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

  Log:
    struct.c: encoding of member name
    
    * struct.c (not_a_member): preserve encoding of member name in
      error messages.

  Modified files:
    trunk/struct.c
    trunk/test/-ext-/struct/test_member.rb
Index: struct.c
===================================================================
--- struct.c	(revision 45462)
+++ struct.c	(revision 45463)
@@ -84,7 +84,7 @@ NORETURN(static void not_a_member(ID id) https://github.com/ruby/ruby/blob/trunk/struct.c#L84
 static void
 not_a_member(ID id)
 {
-    rb_name_error(id, "`%s' is not a struct member", rb_id2name(id));
+    rb_name_error(id, "`%"PRIsVALUE"' is not a struct member", QUOTE_ID(id));
 }
 
 VALUE
Index: test/-ext-/struct/test_member.rb
===================================================================
--- test/-ext-/struct/test_member.rb	(revision 45462)
+++ test/-ext-/struct/test_member.rb	(revision 45463)
@@ -8,5 +8,6 @@ class  Bug::Struct::Test_Member < Test:: https://github.com/ruby/ruby/blob/trunk/test/-ext-/struct/test_member.rb#L8
     s = S.new(1)
     assert_equal(1, s.get(:a))
     assert_raise_with_message(NameError, /is not a struct member/) {s.get(:b)}
+    assert_raise_with_message(NameError, /\u{3042}/) {s.get(:"\u{3042}")}
   end
 end

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

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