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

[BUG] Elvis operator not working correctly (?:) #623

Closed
3 tasks done
ModProg opened this issue Nov 24, 2022 · 3 comments
Closed
3 tasks done

[BUG] Elvis operator not working correctly (?:) #623

ModProg opened this issue Nov 24, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@ModProg
Copy link
Contributor

ModProg commented Nov 24, 2022

Checklist before submitting an issue

  • I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • I have specifically verified that this bug is not a common user error
  • I am providing as much relevant information as I am able to in this bug report (Minimal config to reproduce the issue for example, if applicable)

Description of the bug

Elvis operator works on empty strings but not on null, i.e. "null"?:"hi" will result in null but ""?:"hi" will result in hi.

I also tested it with creating null by indexing an array ([][1]), to make sure it is not just that the string "null" is handled differently.

Reproducing the issue

(defwindow test
  :monitor 0
  (label :text {"[]"[1]?: "hi"}))

Expected behaviour

Should show hi but shows null

Additional context

I noticed that while implementing #622 in yuck.

@ModProg ModProg added the bug Something isn't working label Nov 24, 2022
@viandoxdev
Copy link
Contributor

null and the string null are treated the exact same way by simplexpr IIRC, there is no json value only json operators

@ModProg
Copy link
Contributor Author

ModProg commented Nov 24, 2022

null and the string null are treated the exact same way by simplexpr IIRC, there is no json value only json operators

Thought so too, just wanted to make sure.

@ModProg
Copy link
Contributor Author

ModProg commented Nov 26, 2022

This was fixed since 0.4.0

@ModProg ModProg closed this as completed Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants