diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-12 02:50:50 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-12 02:50:50 +0000 |
commit | af4907c54f5f356d94c9c0ba53539487f8118659 (patch) | |
tree | bc2b3abddbe1a196744326452008bf35a6f2adae /test | |
parent | 26df8ea5bb613bcef93c4db0a8772099b5217d37 (diff) |
merge revision(s) 55609: [Backport #12568]
* vm_args.c (setup_parameters_complex): don't raise ArgumentError
if an array is given for instance_exec with optional argument.
[ruby-core:76300] [Bug #12568]
https://github.com/rails/rails/pull/25699
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@55875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_lambda.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb index 0f3382ce78..b12fcf8834 100644 --- a/test/ruby/test_lambda.rb +++ b/test/ruby/test_lambda.rb @@ -71,6 +71,13 @@ class TestLambdaParameters < Test::Unit::TestCase assert_raise(ArgumentError, bug9605) {proc(&plus).call [1,2]} end + def test_instance_exec + bug12568 = '[ruby-core:76300] [Bug #12568]' + assert_nothing_raised(ArgumentError, bug12568) do + instance_exec([1,2,3], &->(a=[]){ a }) + end + end + def yield_1(arg) yield arg end |