diff options
author | Matthew Draper <matthew@trebex.net> | 2022-07-29 01:08:07 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-28 11:38:07 -0400 |
commit | ab08a43ec5ab7a8d82c980dc1eefc9e5d71e926d (patch) | |
tree | d4f2090229f0e752f638c97c57997afa0a86d2c4 /bootstraptest | |
parent | 18b1e5e6dbef9bb0c265e57e1267840d7c13cd88 (diff) |
YJIT: Teach getblockparamproxy to handle the no-block case without exiting (#6191)
Teach getblockparamproxy to handle the no-block case without exiting
Co-authored-by: John Hawthorn <john@hawthorn.email>
Co-authored-by: John Hawthorn <john@hawthorn.email>
Notes
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 7158486d50..966a5f3002 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -1224,6 +1224,19 @@ assert_equal '[1, 2, 42]', %q{ [foo {1}, foo {2}, foo {42}] } +# test calling without block param +assert_equal '[1, false, 2, false]', %q{ + def bar + block_given? && yield + end + + def foo(&block) + bar(&block) + end + + [foo { 1 }, foo, foo { 2 }, foo] +} + # test calling block param failing assert_equal '42', %q{ def foo(&block) |