diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | test/ruby/test_fiber.rb | 5 | ||||
-rw-r--r-- | test/ruby/test_thread.rb | 5 | ||||
-rw-r--r-- | variable.c | 2 | ||||
-rw-r--r-- | vm_method.c | 9 |
5 files changed, 9 insertions, 19 deletions
@@ -1,3 +1,10 @@ +Sun Aug 18 20:17:41 2013 Kazuki Tsujimoto <[email protected]> + + * 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 <[email protected]> * error.c, file.c, gc.c, hash.c, thread.c, variable.c, vm_eval.c, bin/erb: diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index 25a4608c8a..f3cfaa273b 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -217,10 +217,7 @@ class TestFiber < Test::Unit::TestCase 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 diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 6f33a120f7..dd13842bfe 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -493,10 +493,7 @@ class TestThread < Test::Unit::TestCase 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 diff --git a/variable.c b/variable.c index 0bb91e279f..af1d23a86b 100644 --- a/variable.c +++ b/variable.c @@ -2191,8 +2191,6 @@ rb_define_const(VALUE klass, const char *name, VALUE val) 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); } diff --git a/vm_method.c b/vm_method.c index 969facc3b1..61846c26dd 100644 --- a/vm_method.c +++ b/vm_method.c @@ -672,8 +672,6 @@ remove_method(VALUE klass, ID mid) 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, rb_method_flag_t noex) 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) 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) } rb_frozen_class_p(klass); - if (klass == rb_cObject) { - } again: orig_me = search_method(klass, def, 0); |