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

ruby-changes:30531

From: ktsj <ko1@a...>
Date: Sun, 18 Aug 2013 20:27:50 +0900 (JST)
Subject: [ruby-changes:30531] ktsj:r42610 (trunk): * variable.c, vm_method.c: remove dead code.

ktsj	2013-08-18 20:27:42 +0900 (Sun, 18 Aug 2013)

  New Revision: 42610

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

  Log:
    * variable.c, vm_method.c: remove dead code.
    
    * test/ruby/test_fiber.rb, test/ruby/test_thread.rb:
      change accordingly.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_fiber.rb
    trunk/test/ruby/test_thread.rb
    trunk/variable.c
    trunk/vm_method.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42609)
+++ ChangeLog	(revision 42610)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Aug 18 20:17:41 2013  Kazuki Tsujimoto  <kazuki@c...>
+
+	* variable.c, vm_method.c: remove dead code.
+
+	* test/ruby/test_fiber.rb, test/ruby/test_thread.rb:
+	  change accordingly.
+
 Sun Aug 18 19:32:26 2013  Kazuki Tsujimoto  <kazuki@c...>
 
 	* error.c, file.c, gc.c, hash.c, thread.c, variable.c, vm_eval.c, bin/erb:
Index: variable.c
===================================================================
--- variable.c	(revision 42609)
+++ variable.c	(revision 42610)
@@ -2191,8 +2191,6 @@ rb_define_const(VALUE klass, const char https://github.com/ruby/ruby/blob/trunk/variable.c#L2191
     if (!rb_is_const_id(id)) {
 	rb_warn("rb_define_const: invalid name `%s' for constant", name);
     }
-    if (klass == rb_cObject) {
-    }
     rb_const_set(klass, id, val);
 }
 
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 42609)
+++ vm_method.c	(revision 42610)
@@ -672,8 +672,6 @@ remove_method(VALUE klass, ID mid) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L672
     VALUE self = klass;
 
     klass = RCLASS_ORIGIN(klass);
-    if (klass == rb_cObject) {
-    }
     rb_check_frozen(klass);
     if (mid == object_id || mid == id__send__ || mid == idInitialize) {
 	rb_warn("removing `%s' may cause serious problems", rb_id2name(mid));
@@ -755,9 +753,6 @@ rb_export_method(VALUE klass, ID name, r https://github.com/ruby/ruby/blob/trunk/vm_method.c#L753
     rb_method_entry_t *me;
     VALUE defined_class;
 
-    if (klass == rb_cObject) {
-    }
-
     me = search_method(klass, name, &defined_class);
     if (!me && RB_TYPE_P(klass, T_MODULE)) {
 	me = search_method(rb_cObject, name, &defined_class);
@@ -857,8 +852,6 @@ rb_undef(VALUE klass, ID id) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L852
     if (NIL_P(klass)) {
 	rb_raise(rb_eTypeError, "no class to undef method");
     }
-    if (rb_vm_cbase() == rb_cObject && klass == rb_cObject) {
-    }
     rb_frozen_class_p(klass);
     if (id == object_id || id == id__send__ || id == idInitialize) {
 	rb_warn("undefining `%s' may cause serious problems", rb_id2name(id));
@@ -1207,8 +1200,6 @@ rb_alias(VALUE klass, ID name, ID def) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1200
     }
 
     rb_frozen_class_p(klass);
-    if (klass == rb_cObject) {
-    }
 
   again:
     orig_me = search_method(klass, def, 0);
Index: test/ruby/test_fiber.rb
===================================================================
--- test/ruby/test_fiber.rb	(revision 42609)
+++ test/ruby/test_fiber.rb	(revision 42610)
@@ -217,10 +217,7 @@ class TestFiber < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_fiber.rb#L217
   def test_no_valid_cfp
     bug5083 = '[ruby-dev:44208]'
     assert_equal([], Fiber.new(&Module.method(:nesting)).resume)
-    error = assert_raise(RuntimeError) do
-      Fiber.new(&Module.method(:undef_method)).resume(:to_s)
-    end
-    assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083)
+    assert_instance_of(Class, Fiber.new(&Class.new.method(:undef_method)).resume(:to_s))
   end
 
   def test_prohibit_resume_transfered_fiber
Index: test/ruby/test_thread.rb
===================================================================
--- test/ruby/test_thread.rb	(revision 42609)
+++ test/ruby/test_thread.rb	(revision 42610)
@@ -493,10 +493,7 @@ class TestThread < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L493
     skip 'with win32ole, cannot run this testcase because win32ole redefines Thread#intialize' if defined?(WIN32OLE)
     bug5083 = '[ruby-dev:44208]'
     assert_equal([], Thread.new(&Module.method(:nesting)).value)
-    error = assert_raise(RuntimeError) do
-      Thread.new(:to_s, &Module.method(:undef_method)).join
-    end
-    assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083)
+    assert_instance_of(Thread, Thread.new(:to_s, &Class.new.method(:undef_method)).join)
   end
 
   def make_handle_interrupt_test_thread1 flag

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

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