diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-08 13:14:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-08 13:14:08 +0000 |
commit | 779f4383aa26f6ae5812a723effe27e5387fe2fd (patch) | |
tree | cf3d89ca1ac625c0f90cd5920eb1f00a43fa4e8e /eval.c | |
parent | 875d51ffc93f3404f6b37134dd39b5ad698f6472 (diff) | |
download | ruby-779f4383aa26f6ae5812a723effe27e5387fe2fd.tar.gz |
* eval.c (assign): deal with new block argument.
fixed: [ruby-core:05536]
* eval.c (rb_node_arity): follow change of NODE_ARGS.
fixed: [ruby-dev:26761]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -5269,6 +5269,13 @@ assign(self, lhs, val, pcall) } break; + case NODE_BLOCK: + lhs = lhs->nd_head; + if (nd_type(lhs) == NODE_ARGS) { + formal_assign(self, lhs, 1, &val, 0); + break; + } + default: rb_bug("bug in variable assignment"); break; @@ -9326,7 +9333,7 @@ rb_node_arity(body) if (nd_type(body) == NODE_BLOCK) body = body->nd_head; if (!body) return 0; - n = body->nd_cnt; + n = body->nd_frml ? RARRAY(body->nd_frml)->len : 0; if (body->nd_opt || body->nd_rest) n = -n-1; return n; |