mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (proc_eq): avoid false positive by using scope and
dyna_vars. no longer use frame.uniq.
* eval.c (proc_arity): arity is now defined as number of
parameters that would not be ignored. i.e. Proc.new{}.arity
returns zero. update test suites too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
311fdfdfea
commit
c223709c3b
6 changed files with 18 additions and 9 deletions
|
|
@ -311,8 +311,8 @@ class TestIterator < Test::Unit::TestCase
|
|||
|
||||
block = get_block{11}
|
||||
lambda = lambda{44}
|
||||
assert_equal(-1, block.arity)
|
||||
assert_equal(-1, lambda.arity)
|
||||
assert_equal(0, block.arity)
|
||||
assert_equal(0, lambda.arity)
|
||||
assert_equal(0, lambda{||}.arity)
|
||||
assert_equal(1, lambda{|a|}.arity)
|
||||
assert_equal(1, lambda{|a,|}.arity)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue