jruby/jruby — pull request #1202 by dmarcotte (2013-11-06 01:59:30+00:00)
Title: Centrally prep args for calls/yields

Next slice of #1143 @enebo...

Refactor to ensure at the BlockBody level that args are properly prepped for calls and yields (arity checking for lambdas, arity trimming for other blocks). This doesn't guarantee all calling codepaths are covered (an irresponsible override of some of BlockBody's methods can get around it), but definitely moves in the right direction.

This lets us delete some ad-hoc prepping we were doing, and fills some gaps where args should have been prepped but were not (so, for instance, we can untag the Enumerable#any test now that its block args are being treated correctly).

I'll have a look at continuing to shore this up (checking on the no-array yield, discouraging the bad overrides mentioned above, unifying more places where args are prepped, etc.), but hopefully you agree this is a good place to commit for now.