diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | test/ruby/test_object.rb | 10 | ||||
-rw-r--r-- | vm_eval.c | 1 |
3 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Sat Dec 19 09:58:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * vm_eval.c (check_funcall): reset method_missing_reason before + trying the call. based on a patch from Yehuda Katz in + [ruby-core:27219]. + Sat Dec 19 09:29:22 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca> * lib/set.rb: Add checks that passed argument is Enumerable. diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 8352b03979..0a49422074 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -322,6 +322,16 @@ class TestObject < Test::Unit::TestCase assert_raise(ArgumentError) do c.new.method_missing end + + bug2494 = '[ruby-core:27219]' + c = Class.new do + def method_missing(meth, *args) + super + end + end + b = c.new + foo rescue nil + assert_nothing_raised(bug2494) {[b].flatten} end def test_respond_to_missing @@ -275,6 +275,7 @@ check_funcall(VALUE recv, ID mid, int argc, VALUE *argv) else { struct rescue_funcall_args args; + th->method_missing_reason = 0; args.recv = recv; args.sym = ID2SYM(mid); args.argc = argc; |