cluster: use ObjectPrototypeHasOwnProperty#48141
cluster: use ObjectPrototypeHasOwnProperty#48141nodejs-github-bot merged 2 commits intonodejs:mainfrom
Conversation
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
|
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.) |
|
I'm +1 on adding tests as well. |
|
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>
|
Yes, that's right. This way is safer, but I thought there might be a reason why the properties of |
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. |
|
Landed in b4d5f1f |
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>
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>
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>
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>
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>
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>
This addresses: #48077 (comment)
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com