Skip to content

test: use Object.hasOwn() where applicable - #41664

Merged
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
Trott:hasown
Jan 25, 2022
Merged

test: use Object.hasOwn() where applicable#41664
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
Trott:hasown

Conversation

@Trott

Copy link
Copy Markdown
Member

Replace Object.prototpye.hasOwnProperty() with Object.hasOwn() where
applicable.

Replace Object.prototpye.hasOwnProperty() with Object.hasOwn() where
applicable.
@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. labels Jan 23, 2022
@TrottTrott added dont-land-on-v12.x request-ci Add this label to start a Jenkins CI on a PR. and removed doc Issues and PRs related to the documentations. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. needs-ci PRs that need a full CI run. labels Jan 23, 2022
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 23, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@benjamingrbenjamingr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure, but why? I get the value of hasOwn when interacting with objects whose prototype you can't be certain of but these are our own tests

@aduh95aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The goal is to enforce it with a lint rule in the future? I'm all for it.

@Trott

Trott commented Jan 23, 2022

Copy link
Copy Markdown
MemberAuthor

Sure, but why? I get the value of hasOwn when interacting with objects whose prototype you can't be certain of but these are our own tests

The goal is to enforce it with a lint rule in the future? I'm all for it.

These are all flagged by the no-prototype-builtins rule which is included in the eslint:recommended configuration and which we then explicitly disable. I would like to remove that exception and enable the rule. These account for most of the code flagged, but there are still a few others.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

bnb
bnb approved these changes Jan 24, 2022

@bnbbnb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:))))))))))))

@aduh95aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 24, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@TrottTrott added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 25, 2022
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 25, 2022
@nodejs-github-bot
nodejs-github-bot merged commit e2e2bc8 into nodejs:masterJan 25, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in e2e2bc8

@Trott
Trott deleted the hasown branch January 25, 2022 15:00
ruyadorno pushed a commit that referenced this pull request Feb 8, 2022
Replace Object.prototpye.hasOwnProperty() with Object.hasOwn() where
applicable.
PR-URL: #41664
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@ruyadornoruyadorno mentioned this pull request Feb 8, 2022
danielleadams pushed a commit that referenced this pull request Mar 2, 2022
Replace Object.prototpye.hasOwnProperty() with Object.hasOwn() where
applicable.
PR-URL: #41664
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Mar 3, 2022
Replace Object.prototpye.hasOwnProperty() with Object.hasOwn() where
applicable.
PR-URL: #41664
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Mar 14, 2022
Replace Object.prototpye.hasOwnProperty() with Object.hasOwn() where
applicable.
PR-URL: #41664
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@Trott@nodejs-github-bot@bnb@addaleax@benjamingr@lpinca@aduh95@RaisinTen@Mesteery