ruby-changes:13327
From: nobu <ko1@a...>
Date: Fri, 25 Sep 2009 13:49:10 +0900 (JST)
Subject: [ruby-changes:13327] Ruby:r25091 (trunk): * proc.c (missing_wrap): reverted.
nobu 2009-09-25 13:48:54 +0900 (Fri, 25 Sep 2009) New Revision: 25091 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25091 Log: * proc.c (missing_wrap): reverted. Modified files: trunk/ChangeLog trunk/proc.c trunk/test/ruby/test_object.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 25090) +++ ChangeLog (revision 25091) @@ -1,7 +1,5 @@ -Fri Sep 25 13:05:50 2009 Nobuyoshi Nakada <nobu@r...> +Fri Sep 25 13:04:46 2009 Nobuyoshi Nakada <nobu@r...> - * proc.c (missing_wrap): new_arg is already given if argc > 1. - * proc.c (mnew): fix for instance method of Module, BasicObjec and subclass of a class which overrides respond_to_missing?. based on a patch from Nikolai Lugovoi <nlugovoi AT gmail.com> in Index: proc.c =================================================================== --- proc.c (revision 25090) +++ proc.c (revision 25091) @@ -884,12 +884,12 @@ } static VALUE -missing_wrap(VALUE new_args, VALUE args, int argc, VALUE *argv) +missing_wrap(VALUE dummy, VALUE args, int argc, VALUE *argv) { + VALUE new_args = rb_ary_new4(argc, argv); VALUE obj = RARRAY_PTR(args)[0]; VALUE sym = RARRAY_PTR(args)[1]; - if (argc <= 1) new_args = rb_ary_new4(argc, argv); rb_ary_unshift(new_args, sym); return rb_funcall2(obj, rb_intern("method_missing"), check_argc(RARRAY_LEN(new_args)), RARRAY_PTR(new_args)); Index: test/ruby/test_object.rb =================================================================== --- test/ruby/test_object.rb (revision 25090) +++ test/ruby/test_object.rb (revision 25091) @@ -325,6 +325,7 @@ foo = c.new assert_equal([:foo], foo.foobar); assert_equal([:foo, 1], foo.foobar(1)); + assert_equal([:foo, 1, 2, 3, 4, 5], foo.foobar(1, 2, 3, 4, 5)); assert(foo.respond_to?(:foobar)) assert_equal(false, foo.respond_to?(:foobarbaz)) assert_raise(NoMethodError) do @@ -334,6 +335,7 @@ foobar = foo.method(:foobar) assert_equal([:foo], foobar.call); assert_equal([:foo, 1], foobar.call(1)); + assert_equal([:foo, 1, 2, 3, 4, 5], foobar.call(1, 2, 3, 4, 5)); c = Class.new(c) assert_equal(false, c.method_defined?(:foobar)) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/