summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-19 15:42:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-19 15:42:26 +0000
commitabeedb0875f3fb8e8d1329b8dc885b159cb61841 (patch)
tree015944ec5e97a34f9f989c320aadfb2a6896d049 /enum.c
parentb70f99d15f3f139523aa8f1dcb200fa8a8aaa16b (diff)
array.c, enum.c: TypeError in zip
* array.c (take_items), enum.c (enum_zip): raise TypeError at non-enumerable objects, not NoMethodError. [ruby-dev:46145] [Bug #7038] * vm_eval.c (rb_check_block_call): check_funcall variant with block function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/enum.c b/enum.c
index ac86c9d..0e4cf33 100644
--- a/enum.c
+++ b/enum.c
@@ -2010,6 +2010,7 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
if (!allary) {
CONST_ID(conv, "to_enum");
for (i=0; i<argc; i++) {
+ if (!rb_respond_to(argv[i], id_each)) Check_Type(argv[i], T_ARRAY);
argv[i] = rb_funcall(argv[i], conv, 1, ID2SYM(id_each));
}
}