From 629d26ef3a41cf585f92ac6d0d8b0a17a47c3daa Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 20 Aug 2015 05:13:28 +0000 Subject: vm_eval.c: share with rb_obj_respond_to * vm_eval.c (check_funcall_respond_to): share the behavior with rb_obj_respond_to. [ruby-core:70460] [Bug #11465] * vm_method.c (vm_respond_to): extract from rb_obj_respond_to and merge r39881. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_array.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 977c14cfa0..ea551dbeba 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -855,6 +855,28 @@ class TestArray < Test::Unit::TestCase assert_match(/reentered/, e.message, '[ruby-dev:34798]') end + def test_flatten_respond_to_missing + bug11465 = '[ruby-core:70460] [Bug #11465]' + + obj = Class.new do + def respond_to_missing?(method, stuff) + return false if method == :to_ary + super + end + + def method_missing(*args) + super + end + end.new + + ex = nil + trace = TracePoint.new(:raise) do |tp| + ex = tp.raised_exception + end + trace.enable {[obj].flatten} + assert_nil(ex, bug11465) + end + def test_permutation_with_callcc need_continuation n = 1000 -- cgit v1.2.3