Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deletion using assigning empty against arrays #2133

Merged
merged 2 commits into from
Jul 8, 2023

Conversation

itchyny
Copy link
Contributor

@itchyny itchyny commented May 29, 2020

This pull request fixes #2051, by delaying path deletions. Also fixes #2397, fixes #2422 and fixes #2440.

 % ./jq -c '(.[] | select(. >= 2)) |= empty' <<< '[1,5,3,0,7]'
[1,0]
 % ./jq -c '.[] |= select(. >= 4)' <<< '[1,5,3,0,7]'
[5,7]
 % ./jq -c '.[] |= select(. == 2)' <<< '[1,5,3,0,7]'
[]

@coveralls
Copy link

coveralls commented May 29, 2020

Coverage Status

Coverage remained the same at 84.134% when pulling d452f7d on itchyny:fix-modify-array-empty into 6306ac8 on stedolan:master.

src/builtin.jq Outdated Show resolved Hide resolved
@nicowilliams nicowilliams merged commit af57893 into jqlang:master Jul 8, 2023
@nicowilliams
Copy link
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants