-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
assert: fix boxed primitives in deep*Equal #15050
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Unbox all primitives and compare them as well instead of only comparing boxed strings.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,7 +116,8 @@ assert.deepStrictEqual(new Boolean(false), test.toObject(false)); | |
| assert.deepStrictEqual(new Boolean(true), test.toObject(true)); | ||
| assert.deepStrictEqual(new String(''), test.toObject('')); | ||
| assert.deepStrictEqual(new Number(0), test.toObject(0)); | ||
| assert.deepStrictEqual(new Number(Number.NaN), test.toObject(Number.NaN)); | ||
| // TODO: Add test back in as soon as NaN is properly compared | ||
| // assert.deepStrictEqual(new Number(Number.NaN), test.toObject(Number.NaN)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove the todo and add the test back?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not before #15036 landed (still trying to figure out if that one should be semver-major or a patch though). Otherwise the test would fail.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the depedency of this change to #15036?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you pushed you changes to this PR? Looks like these lines are still commented?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks a lot for reminding me! It is now back in place. |
||
| assert.deepStrictEqual(new Object(testSym), test.toObject(testSym)); | ||
| assert.notDeepStrictEqual(false, test.toObject(false)); | ||
| assert.notDeepStrictEqual(true, test.toObject(true)); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC this also affects objects with custom
valueOf, so the documentation needs to be updated as well..There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! I am going to add that to the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed