1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm.c (th_yield_setup_args): |v| should work as |v,|.

ex) def m;yield 1, 2; end; m{|v| p v} #=> 1
* parse.y: apply above change for "for" statement.
* test/ruby/test_assignment.rb: ditto
* test/ruby/test_basicinstructions.rb: ditto.
* test/ruby/test_iterator.rb: ditto.
* test/ruby/test_yield.rb: ditto.
* compile.c (iseq_compile_each): fix debug.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2007-06-15 03:27:33 +00:00
parent 70df6311af
commit 7567fbf080
8 changed files with 75 additions and 34 deletions

View file

@ -365,7 +365,7 @@ class TestIterator < Test::Unit::TestCase
def test_assoc_yield
[{:key=>:value}, H.new].each {|h|
h.each{|a| assert_equal([:key, :value], a)}
h.each{|a| assert_equal(:key, a)} # changed at 1.9
h.each{|*a| assert_equal([:key, :value], a)}
h.each{|k,v| assert_equal([:key, :value], [k,v])}
}
@ -480,3 +480,4 @@ class TestIterator < Test::Unit::TestCase
assert_equal(["b"], ["a", "b", "c"].grep(IterString.new("b")) {|s| s})
end
end
GC.stress=true