Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upFix runtime error when testing equality of Json.Encode.null values #294
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ThomasWeiser
Oct 11, 2015
Contributor
Rebased to current master.
Ready for being merged for upcoming relase 3.0.0
|
Rebased to current master. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jun 25, 2016
Member
6f5fbb8 does a check like this, and 1c00777 makes a note that it will not be possible to check for equality on Json.Encode.Value once a proper fix is implemented. That scenario is fundamentally problematic because a Json.Encode.Value can come through ports, meaning it can have functions.
This issue blocked because it was not clear what the ultimate fix would be. Now that it is clearer, I am fine with doing the stopgap.
|
6f5fbb8 does a check like this, and 1c00777 makes a note that it will not be possible to check for equality on This issue blocked because it was not clear what the ultimate fix would be. Now that it is clearer, I am fine with doing the stopgap. |
ThomasWeiser commentedJul 14, 2015
Function
eqin Utils.js is currently only suitable for normal Elm types, not for arbitrary (speakJson.Encode) values.As a result, comparing
Json.Encode.nullwith anything non-null throws a runtime error.Example:
This PR fixes these cases.
Unit-tests are added to tests/Test/Equality.elm