summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-11-07 07:45:57 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-11-07 07:45:57 +0000
commitf54e979d36e226fb2f9aca78efddd46422ce25f1 (patch)
tree726f7ea8b36eb91919f1306cb5c2889de57b5bfb /eval.c
parent0ee03fefad15b93f5320b5270aaf03d518969708 (diff)
* eval.c (when_check): need to splat for NODE_ARGSCAT as well.
[ruby-dev:29860] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 9b8af94f37..cbf0e19606 100644
--- a/eval.c
+++ b/eval.c
@@ -2723,7 +2723,9 @@ when_check(NODE *tag, VALUE val, VALUE self)
}
break;
case NODE_SPLAT:
- elm = splat_value(rb_eval(self, tag->nd_head));
+ tag = tag->nd_head;
+ splat:
+ elm = splat_value(rb_eval(self, tag));
for (i=0; i<RARRAY_LEN(elm); i++) {
if (when_cond(val, RARRAY_PTR(elm)[i])) {
return Qtrue;
@@ -2732,7 +2734,8 @@ when_check(NODE *tag, VALUE val, VALUE self)
break;
case NODE_ARGSCAT:
if (when_check(tag->nd_head, val, self)) return Qtrue;
- return when_check(tag->nd_body, val, self);
+ tag = tag->nd_body;
+ goto splat;
case NODE_ARGSPUSH:
if (when_check(tag->nd_head, val, self)) return Qtrue;
if (when_cond(val, rb_eval(self, tag->nd_body))) return Qtrue;