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

ruby-changes:14683

From: nobu <ko1@a...>
Date: Mon, 1 Feb 2010 16:50:12 +0900 (JST)
Subject: [ruby-changes:14683] Ruby:r26535 (ruby_1_8): * eval.c (proc_invoke): reverted r25975.

nobu	2010-02-01 16:40:45 +0900 (Mon, 01 Feb 2010)

  New Revision: 26535

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

  Log:
    * eval.c (proc_invoke): reverted r25975.  [ruby-dev:39931]
      [ruby-dev:40059]

  Modified files:
    branches/ruby_1_8/eval.c
    branches/ruby_1_8/test/ruby/test_super.rb

Index: ruby_1_8/test/ruby/test_super.rb
===================================================================
--- ruby_1_8/test/ruby/test_super.rb	(revision 26534)
+++ ruby_1_8/test/ruby/test_super.rb	(revision 26535)
@@ -149,4 +149,25 @@
     c = C.new
     assert_equal([c, "#{c.to_s}::m"], c.m, bug2419)
   end
+
+  module Bug2537
+    class Parent
+      def run(a)
+        a
+      end
+    end
+
+    class Child < Parent
+      def run(*a)
+        proc {super(*a)}.call
+      end
+    end
+  end
+
+  def test_super_in_block_call
+    bug2537 = '[ruby-dev:39931]'
+    assert_nothing_raised(bug2537) do
+      assert_equal(bug2537, Bug2537::Child.new.run(bug2537), bug2537)
+    end
+  end
 end
Index: ruby_1_8/eval.c
===================================================================
--- ruby_1_8/eval.c	(revision 26534)
+++ ruby_1_8/eval.c	(revision 26535)
@@ -8958,8 +8958,7 @@
     _block = *data;
     _block.block_obj = bvar;
     if (self != Qundef) _block.frame.self = self;
-    _block.frame.last_class = klass;
-    if (!klass) _block.frame.last_func = 0;
+    if (klass) _block.frame.last_class = klass;
     _block.frame.argc = RARRAY(tmp)->len;
     _block.frame.flags = ruby_frame->flags;
     if (_block.frame.argc && DMETHOD_P()) {

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

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