[SERVER-32665] tojson should print the elements when passed a Set object Created: 11/Jan/18 Updated: 04/Jan/23 Resolved: 04/Jan/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | JavaScript, Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Kevin Albertson | Assignee: | Backlog - Server Tooling and Methods (STM) (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | stm, tig-assertjs, tig-qwin-eligible | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Assigned Teams: |
Server Tooling & Methods
|
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Story Points: | 2 | ||||||||||||||||||||
| Description |
|
In the shell, doing:
Just prints out a misleading "{ }". tojson should either explicitly throw an error or print out the elements. |
| Comments |
| Comment by Romans Kasperovics [ 04/Jan/23 ] |
|
This issue was solved within |
| Comment by Romans Kasperovics [ 04/Jan/23 ] |
|
There is a separate function assert.setEq() which compares two sets properly. |
| Comment by Steven Vannelli [ 10/May/22 ] |
|
Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions. |
| Comment by Max Hirschhorn [ 06/Nov/18 ] |
|
We should take care to ensure that order is ignored if we choose to convert the Set instance to an Array instance. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values |
| Comment by David Bradford (Inactive) [ 30/Jul/18 ] |
|
Because assert.eq function uses friendlyEqual, which uses tojson, this issue means that assert.eq will always be successful with Sets even if it should fail. Moving to the TIG backlog to get prioritized. |
| Comment by Gregory McKeon (Inactive) [ 22/Jan/18 ] |
|
The platforms team isn't prioritizing this, but PR's are welcome! |