mirror of
https://github.com/ArnoldSmith86/virtualtabletop.git
synced 2026-03-02 22:57:02 -05:00
Array comparison fails #304
Labels
No labels
PCIO compatibility
Validator
automated testing
bug
documentation
duplicate
editor
enhancement
enhancement
library
library
maintenance
needs legacy server
pile related
reported client crash
routine operations
user interface
widget properties
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/virtualtabletop#304
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rogerl50 on GitHub (Jul 2, 2021).
The following
clickRoutine:takes the
elsebranch.@robartsd commented on GitHub (Jul 2, 2021):
All object comparisons fail because we test
===instead of==.@rogerl50 commented on GitHub (Jul 2, 2021):
So I guess I need to get the length of the array I'm comparing to
[]and compare that to zero, unless there's a better way.@robartsd commented on GitHub (Jul 2, 2021):
For now, yes. Discuss issue in #615.
@rogerl50 commented on GitHub (Jul 2, 2021):
Should this issue be linked to #615, or just closed?
@robartsd commented on GitHub (Jul 2, 2021):
I was mistaken
IFdoes use==onlySELECTis using===currently. But it looks like==does not return true for arrays unless they are the same object. Perhaps we should implement a deep comparison of objects as I believe we would like==to return true in this case.@ArnoldSmith86 commented on GitHub (Jul 2, 2021):
Not sure. Another solution is to offer JSON stringify and parse and let the user compare that instead.
Doing that automatically in == might be OK though. The normal behavior is probably never useful for us.
@robartsd commented on GitHub (Jul 2, 2021):
Of course for objects, JSON stringify could still be inadequate as the key order is not guaranteed. We might want to turn to something like https://github.com/substack/json-stable-stringify (could also be useful for TestCafe checks, but I don't think we've yet run into issues where key insertion order has caused problems there).