diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-03-31 00:10:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 16:10:57 +0900 |
commit | bb93659fefd7f4557129043742771a33bd30c255 (patch) | |
tree | 6d9074b15d4873420b4111274220972b3fe2799d /test/json | |
parent | d04856bdc502eec4055da1e5cf717639c314e189 (diff) | |
download | ruby-bb93659fefd7f4557129043742771a33bd30c255.tar.gz |
Fix pp when passed a empty ruby2_keywords-flagged hash as array element (#2966)
This causes problems because the hash is passed to a block not
accepting keywords. Because the hash is empty and keyword flagged,
it is removed before calling the block. This doesn't cause an
ArgumentError because it is a block and not a lambda. Just like
any other block not passed required arguments, arguments not
passed are set to nil.
Issues like this are a strong reason not to have ruby2_keywords
by default.
Fixes [Bug #16519]
This backports 28d31ead34baff1c4abc0d7d902ef4bc1d576fb2 and
0ea759eac9234afc47e8fb1bcacfe9ee12c8ffb6, but needed to be modified
for 2.7 as 2.7 will perform empty keyword to positional hash
conversion for required arguments, which will happen if "v" in the
seplist method is empty when yielded.
Co-authored-by: NARUSE, Yui <nurse@users.noreply.github.com>
Diffstat (limited to 'test/json')
0 files changed, 0 insertions, 0 deletions