fix(assert): make prototype of Object.prototype not equal undefined prototype#6484
Draft
WWRS wants to merge 1 commit intodenoland:mainfrom
Draft
fix(assert): make prototype of Object.prototype not equal undefined prototype#6484WWRS wants to merge 1 commit intodenoland:mainfrom
WWRS wants to merge 1 commit intodenoland:mainfrom
Conversation
WWRS
commented
Mar 17, 2025
| }); | ||
| }); | ||
|
|
||
| Deno.test("equal() considers object with prototype Object.prototype not equal to object with no prototype", () => { |
Contributor
Author
There was a problem hiding this comment.
Is this too long a name? Suggestions on making it shorter?
Contributor
Author
|
Changed to draft because I realized this makes behavior different when objects have properties: #6334 (comment) |
Contributor
|
This PR hasn't had activity in almost 6 months. Should we close as stale for now? |
Contributor
Author
|
We would need to disambiguate the behavior mentioned in #6334. Determining this behavior doesn't seem like a priority, so if this PR is not moving toward either being outright accepted or outright rejected, it's stale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6334
These were previously hardcoded to be equal, and I'm not completely sure why. I hope I'm not missing something.
It's not mentioned in the PR when it was added (#6153). I suspect it was a port of the old system, where constructors were checked rather than prototypes: Undefined constructor could equal Object constructor. But undefined prototype should not equal Object prototype.