diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-30 06:00:24 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-30 06:00:24 +0000 |
commit | 20c0fb69d65f20d42caf980de042396370dd0ba4 (patch) | |
tree | 6e4483a32181bc4e10dea1e42948ecdb920890c6 /array.c | |
parent | 00d6bb5108209329996c8062ce3e947489c38ea7 (diff) | |
download | ruby-20c0fb69d65f20d42caf980de042396370dd0ba4.tar.gz |
* array.c (rb_ary_bsearch): Raise TypeError on bad return from block
* range.c (range_bsearch): ditto
* test/ruby/test_array.rb (class): Test for above
* test/ruby/test_range.rb (class): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2462,7 +2462,9 @@ rb_ary_bsearch(VALUE ary) } } else { - smaller = RTEST(v); + rb_raise(rb_eTypeError, "wrong argument type %s" + "(must respond be numeric, true, false or nil)", + rb_obj_classname(v)); } if (smaller) { high = mid; |