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

ruby-changes:31282

From: nobu <ko1@a...>
Date: Sat, 19 Oct 2013 08:50:19 +0900 (JST)
Subject: [ruby-changes:31282] nobu:r43361 (trunk): gc.c: fix arity

nobu	2013-10-19 08:50:13 +0900 (Sat, 19 Oct 2013)

  New Revision: 43361

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

  Log:
    gc.c: fix arity
    
    * gc.c (Init_GC): fix arity of key? method.

  Modified files:
    trunk/gc.c
    trunk/test/test_weakref.rb
Index: gc.c
===================================================================
--- gc.c	(revision 43360)
+++ gc.c	(revision 43361)
@@ -6257,7 +6257,7 @@ Init_GC(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L6257
 	rb_define_method(rb_cWeakMap, "[]", wmap_aref, 1);
 	rb_define_method(rb_cWeakMap, "include?", wmap_has_key, 1);
 	rb_define_method(rb_cWeakMap, "member?", wmap_has_key, 1);
-	rb_define_method(rb_cWeakMap, "key?", wmap_has_key, 0);
+	rb_define_method(rb_cWeakMap, "key?", wmap_has_key, 1);
 	rb_define_method(rb_cWeakMap, "inspect", wmap_inspect, 0);
 	rb_define_method(rb_cWeakMap, "each", wmap_each, 0);
 	rb_define_method(rb_cWeakMap, "each_pair", wmap_each, 0);
Index: test/test_weakref.rb
===================================================================
--- test/test_weakref.rb	(revision 43360)
+++ test/test_weakref.rb	(revision 43361)
@@ -18,9 +18,11 @@ class TestWeakRef < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_weakref.rb#L18
   def test_recycled
     weak, str = make_weakref
     assert_nothing_raised(WeakRef::RefError) {weak.to_s}
+    assert_predicate(weak, :weakref_alive?)
     ObjectSpace.garbage_collect
     ObjectSpace.garbage_collect
     assert_raise(WeakRef::RefError) {weak.to_s}
+    assert_not_predicate(weak, :weakref_alive?)
   end
 
   def test_not_reference_different_object

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

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