Skip to content

cluster: use ObjectPrototypeHasOwnProperty - #48141

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
daeyeon:main.has-own-230523.Tue.862f
May 25, 2023
Merged

cluster: use ObjectPrototypeHasOwnProperty#48141
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
daeyeon:main.has-own-230523.Tue.862f

Conversation

@daeyeon

Copy link
Copy Markdown
Member

This addresses: #48077 (comment)

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
@nodejs-github-botnodejs-github-bot added cluster Issues and PRs related to the cluster subsystem. needs-ci PRs that need a full CI run. labels May 23, 2023
@TrottTrott added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels May 23, 2023
@Trott

Copy link
Copy Markdown
Member

Should we add a test that modifies the prototype chain? (I generally prefer to add tests, but I can also see an argument that it might be a bit much to always add tests for primordials. I guess I'd prefer a test be added, but not so strongly that I'd block this landing without a test.)

@anonrig

Copy link
Copy Markdown
Member

I'm +1 on adding tests as well.

@daeyeon

daeyeon commented May 24, 2023

Copy link
Copy Markdown
MemberAuthor

On second thought as I added the test, I think that the builtin doesn't prevent changes to the process.env prototype. Closing as we don't have a clue it needs to be applied to cluster only. Thanks for the review!

@daeyeondaeyeon closed this May 24, 2023
@daeyeon
daeyeon deleted the main.has-own-230523.Tue.862f branch May 24, 2023 00:53
@Trott

Copy link
Copy Markdown
Member

On second thought as I added the test, I think that the builtin doesn't prevent changes to the process.env prototype. Closing as we don't have a clue it needs to be applied to cluster only. Thanks for the review!

We can't avoid changes to process.env prototype, but we can avoid those prototype changes affecting the behavior of the cluster module and other modules. That's what this is about, right? I think we should re-open this.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
@daeyeon
daeyeon restored the main.has-own-230523.Tue.862f branch May 25, 2023 09:11
@daeyeondaeyeon reopened this May 25, 2023
@daeyeon

Copy link
Copy Markdown
MemberAuthor

Yes, that's right. This way is safer, but I thought there might be a reason why the properties of process.env are just used in the other builtin modules. Maybe I was overly concerned.. Re-opened this with a test. PTAL.

@daeyeondaeyeon added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. request-ci Add this label to start a Jenkins CI on a PR. labels May 25, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 25, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Copy link
Copy Markdown
Member

This way is safer, but I thought there might be a reason why the properties of process.env are just used in the other builtin modules.

It's possible that there would be significant negative performance implications in some hot paths, but I don't think this is one of those.

@anonriganonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels May 25, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 25, 2023
@nodejs-github-bot
nodejs-github-bot merged commit b4d5f1f into nodejs:mainMay 25, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in b4d5f1f

@daeyeon
daeyeon deleted the main.has-own-230523.Tue.862f branch May 26, 2023 04:24
targos pushed a commit that referenced this pull request May 30, 2023
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: #48141
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
@targostargos mentioned this pull request Jun 4, 2023
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: #48141
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
MoLow pushed a commit to MoLow/node that referenced this pull request Jul 6, 2023
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: nodejs#48141
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: nodejs#48141
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: nodejs#48141
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.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.clusterIssues and PRs related to the cluster subsystem.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@daeyeon@Trott@anonrig@nodejs-github-bot