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

ruby-changes:16006

From: shyouhei <ko1@a...>
Date: Sat, 22 May 2010 19:41:52 +0900 (JST)
Subject: [ruby-changes:16006] Ruby:r27954 (ruby_1_8_7): merge revision(s) 26534:26536:

shyouhei	2010-05-22 19:41:43 +0900 (Sat, 22 May 2010)

  New Revision: 27954

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

  Log:
    merge revision(s) 26534:26536:
    * eval.c (proc_invoke): reverted r25975.  [ruby-dev:39931]
      [ruby-dev:40059]
    * eval.c (rb_mod_define_method): return original block but not
      bound block.  [ruby-core:26984]

  Modified files:
    branches/ruby_1_8_7/ChangeLog
    branches/ruby_1_8_7/eval.c
    branches/ruby_1_8_7/test/ruby/test_super.rb
    branches/ruby_1_8_7/version.h

Index: ruby_1_8_7/ChangeLog
===================================================================
--- ruby_1_8_7/ChangeLog	(revision 27953)
+++ ruby_1_8_7/ChangeLog	(revision 27954)
@@ -1,3 +1,11 @@
+Sat May 22 19:36:38 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* eval.c (proc_invoke): reverted r25975.  [ruby-dev:39931]
+	  [ruby-dev:40059]
+
+	* eval.c (rb_mod_define_method): return original block but not
+	  bound block.  [ruby-core:26984]
+
 Thu May 20 16:28:17 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/webrick/httpservlet/filehandler.rb (make_partial_content):
Index: ruby_1_8_7/version.h
===================================================================
--- ruby_1_8_7/version.h	(revision 27953)
+++ ruby_1_8_7/version.h	(revision 27954)
@@ -1,15 +1,15 @@
 #define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2010-05-20"
+#define RUBY_RELEASE_DATE "2010-05-22"
 #define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20100520
-#define RUBY_PATCHLEVEL 259
+#define RUBY_RELEASE_CODE 20100522
+#define RUBY_PATCHLEVEL 260
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
 #define RUBY_VERSION_TEENY 7
 #define RUBY_RELEASE_YEAR 2010
 #define RUBY_RELEASE_MONTH 5
-#define RUBY_RELEASE_DAY 20
+#define RUBY_RELEASE_DAY 22
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];
Index: ruby_1_8_7/test/ruby/test_super.rb
===================================================================
--- ruby_1_8_7/test/ruby/test_super.rb	(revision 27953)
+++ ruby_1_8_7/test/ruby/test_super.rb	(revision 27954)
@@ -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_7/eval.c
===================================================================
--- ruby_1_8_7/eval.c	(revision 27953)
+++ ruby_1_8_7/eval.c	(revision 27954)
@@ -8868,8 +8868,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()) {
@@ -9967,7 +9966,7 @@
     VALUE mod;
 {
     ID id;
-    VALUE body;
+    VALUE body, orig;
     NODE *node;
     int noex;
 
@@ -9986,6 +9985,7 @@
     else {
 	rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
     }
+    orig = body;
     if (RDATA(body)->dmark == (RUBY_DATA_FUNC)bm_mark) {
 	node = NEW_DMETHOD(method_unbind(body));
     }
@@ -10014,7 +10014,7 @@
 	}
     }
     rb_add_method(mod, id, node, noex);
-    return body;
+    return orig;
 }
 
 /*

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

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