diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-20 05:13:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-20 05:13:28 +0000 |
commit | 629d26ef3a41cf585f92ac6d0d8b0a17a47c3daa (patch) | |
tree | b2fe87f9c90528d9506a8dda119954ffa13803bd /test/ruby | |
parent | 24da2db3e1eab67b6ee7be00d75b73beb273a4c4 (diff) | |
download | ruby-629d26ef3a41cf585f92ac6d0d8b0a17a47c3daa.tar.gz |
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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_array.rb | 22 |
1 files changed, 22 insertions, 0 deletions
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 |