зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
875d51ffc9
Коммит
779f4383aa
|
@ -1,3 +1,11 @@
|
||||||
|
Mon Aug 8 22:13:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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]
|
||||||
|
|
||||||
Mon Aug 8 21:28:13 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
Mon Aug 8 21:28:13 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||||
|
|
||||||
* test/ruby/test_fnmatch.rb: separated from test_file.rb.
|
* test/ruby/test_fnmatch.rb: separated from test_file.rb.
|
||||||
|
|
9
eval.c
9
eval.c
|
@ -5269,6 +5269,13 @@ assign(self, lhs, val, pcall)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NODE_BLOCK:
|
||||||
|
lhs = lhs->nd_head;
|
||||||
|
if (nd_type(lhs) == NODE_ARGS) {
|
||||||
|
formal_assign(self, lhs, 1, &val, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
rb_bug("bug in variable assignment");
|
rb_bug("bug in variable assignment");
|
||||||
break;
|
break;
|
||||||
|
@ -9326,7 +9333,7 @@ rb_node_arity(body)
|
||||||
if (nd_type(body) == NODE_BLOCK)
|
if (nd_type(body) == NODE_BLOCK)
|
||||||
body = body->nd_head;
|
body = body->nd_head;
|
||||||
if (!body) return 0;
|
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)
|
if (body->nd_opt || body->nd_rest)
|
||||||
n = -n-1;
|
n = -n-1;
|
||||||
return n;
|
return n;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче