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

ruby-changes:32113

From: nobu <ko1@a...>
Date: Sat, 14 Dec 2013 11:24:41 +0900 (JST)
Subject: [ruby-changes:32113] nobu:r44192 (trunk): object.c: fix typo

nobu	2013-12-14 11:24:35 +0900 (Sat, 14 Dec 2013)

  New Revision: 44192

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

  Log:
    object.c: fix typo
    
    * object.c (rb_mod_const_get): fix typo.  should use SYM2ID() not
      ID2SYM().

  Modified files:
    trunk/object.c
    trunk/test/ruby/test_module.rb
Index: object.c
===================================================================
--- object.c	(revision 44191)
+++ object.c	(revision 44192)
@@ -2084,7 +2084,7 @@ rb_mod_const_get(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/object.c#L2084
     }
 
     if (SYMBOL_P(name)) {
-	id = ID2SYM(name);
+	id = SYM2ID(name);
 	if (!rb_is_const_id(id)) goto wrong_id;
 	return RTEST(recur) ? rb_const_get(mod, id) : rb_const_get_at(mod, id);
     }
Index: test/ruby/test_module.rb
===================================================================
--- test/ruby/test_module.rb	(revision 44191)
+++ test/ruby/test_module.rb	(revision 44192)
@@ -297,7 +297,7 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L297
     assert_equal [:Foo, :Bar, :Baz], classes
   end
 
-  def test_nested_bad_class
+  def test_nested_get_bad_class
     assert_raise(TypeError) do
       self.class.const_get([User, 'USER', 'Foo'].join('::'))
     end

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

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