Skip to content
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

fix(assert): handle __proto__ correctly in assertObjectMatch #6342

Merged
merged 5 commits into from
Jan 15, 2025

Conversation

yuhr
Copy link
Contributor

@yuhr yuhr commented Jan 10, 2025

Fixes #6341.

@yuhr yuhr requested a review from kt3k as a code owner January 10, 2025 13:46
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.40%. Comparing base (0339121) to head (de93e5b).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6342      +/-   ##
==========================================
- Coverage   96.43%   96.40%   -0.03%     
==========================================
  Files         547      549       +2     
  Lines       41812    41851      +39     
  Branches     6347     6348       +1     
==========================================
+ Hits        40322    40348      +26     
- Misses       1449     1463      +14     
+ Partials       41       40       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

deno.json Outdated Show resolved Hide resolved
Comment on lines +70 to +71
const memo = seen.get(a);
if (memo && (memo === b)) return a;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change necessary? What happens if memo is the value false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just performance thing. If you read the context of the changed lines, you'll realize that will never happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See these types: cfbff35

If you say this change should be done in another PR, I understand it and revert this part, but I'd say such a trivial and small change can be okay to come along with...

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@kt3k kt3k merged commit b1b557e into denoland:main Jan 15, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertObjectMatch is not able to test target object's own __proto__
2 participants