diff options
| author | eileencodes <eileencodes@gmail.com> | 2024-07-23 15:12:12 -0400 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2024-07-23 21:45:40 -0400 |
| commit | 70d4dcb76ca185120172089b3a8480a69fa6a063 (patch) | |
| tree | 84fe918b5610fa398804dbba87e566f741dec444 /test | |
| parent | 4b44590d390f59dbf4d0cb922618ff5cc5b5411a (diff) | |
[Prism] Use `putnil` for nil kwargs, not `putobject {}`
This addresses one of the issues in the `test_kw_splat_nil` failure, but
doesn't make the test pass because of other changes that need to be made
to Prism directly.
One issue was when we have the following code Prism was using
`putobject` with an empty hash whereas the parse.y parser used `putnil`.
```ruby
:ok.itself(**nil)
```
Before:
```
0000 putobject :ok ( 1)[Li]
0002 putobject {}
0004 opt_send_without_block <calldata!mid:itself, argc:1, KW_SPLAT>
0006 leave
```
After:
```
== disasm: #<ISeq:<main>@test2.rb:1 (1,0)-(1,17)>
0000 putobject :ok ( 1)[Li]
0002 putnil
0003 opt_send_without_block <calldata!mid:itself, argc:1, KW_SPLAT>
0005 leave
```
Related to ruby/prism#2935.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11232
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions
