Permalink
Browse files

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]


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@27954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 1f95371 commit b08117e547ecda1168d6c9444b6bf6c9955ade28 @shyouhei shyouhei committed May 22, 2010
Showing with 37 additions and 8 deletions.
  1. +8 −0 ChangeLog
  2. +4 −4 eval.c
  3. +21 −0 test/ruby/test_super.rb
  4. +4 −4 version.h
View
@@ -1,3 +1,11 @@
+Sat May 22 19:36:38 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* lib/webrick/httpservlet/filehandler.rb (make_partial_content):
View
8 eval.c
@@ -8868,8 +8868,7 @@ proc_invoke(proc, args, self, klass)
_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 @@ rb_mod_define_method(argc, argv, mod)
VALUE mod;
{
ID id;
- VALUE body;
+ VALUE body, orig;
NODE *node;
int noex;
@@ -9986,6 +9985,7 @@ rb_mod_define_method(argc, argv, mod)
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_mod_define_method(argc, argv, mod)
}
}
rb_add_method(mod, id, node, noex);
- return body;
+ return orig;
}
/*
View
@@ -149,4 +149,25 @@ def test_define_method
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
View
@@ -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[];

0 comments on commit b08117e

Please sign in to comment.