From 1e51a7b2c6ba2a53f7a7a87244d76351be868999 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 22 Feb 2009 01:47:11 +0000 Subject: * vm_eval.c (method_missing): should not pop cfp if missing method is method_missing. [ruby-core:22298] * vm_eval.c (rb_raise_method_missing): new function to directly raise NoMethodError. * vm_insnhelper.c (vm_call_method): fixed the case method_missing is missing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_method.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bootstraptest/test_method.rb') diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb index 136fce4970..8953a0d4d1 100644 --- a/bootstraptest/test_method.rb +++ b/bootstraptest/test_method.rb @@ -1140,3 +1140,14 @@ assert_equal 'Object#foo', %q{ end Foo.foo }, '[ruby-dev:37587]' + +assert_normal_exit %q{ + class BasicObject + remove_method :method_missing + end + begin + "a".lalala! + rescue NoMethodError => e + e.message == "undefined method `lalala!' for \"a\":String" ? :ok : :ng + end +}, '[ruby-core:22298]' -- cgit v1.2.3