Block argument handling is inconsistent in 1.9 mode
---------------------------------------------------

                 Key: JRUBY-5997
                 URL: https://jira.codehaus.org/browse/JRUBY-5997
             Project: JRuby
          Issue Type: Bug
         Environment: x86_64-darwin10.7.0
            Reporter: Ilya Grigorik
            Assignee: Thomas E Enebo
             Fix For: JRuby 1.x+


Handling of passed in block params in --1.9 mode is different from MRI Ruby. In 
1.8 (default) mode the behavior is as expected, but 1.9 is inconsistent (tested 
with jruby-head, same behavior). Example:

<pre>
blk = Proc.new {|a,*b| p [:block_args, a,b] }

blk.call(1,2,3)
blk.call([1,2,3])

----

igrigorik { /git/goliath/examples } > ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]

igrigorik { /git/goliath/examples } > ruby test.rb 
[:block_args, 1, [2, 3]]
[:block_args, 1, [2, 3]]

igrigorik { /git/goliath/examples } > rvm use jruby
Using /Users/igrigorik/.rvm/gems/jruby-1.6.2

igrigorik { /git/goliath/examples } > jruby --1.9 test.rb 
[:block_args, 1, [2, 3]]
[:block_args, [1, 2, 3], []]         <<<<<<<<<<<<<<<<<<<<<<< Hmmm?

igrigorik { /git/goliath/examples } > jruby  test.rb 
[:block_args, 1, [2, 3]]
[:block_args, 1, [2, 3]]
</pre>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to