lib: use `__proto__: null` when calling `ObjectDefineProperty` by aduh95 · Pull Request #64239 · nodejs/node · GitHub
Skip to content

lib: use __proto__: null when calling ObjectDefineProperty#64239

Open
aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:proto-null-define
Open

lib: use __proto__: null when calling ObjectDefineProperty#64239
aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:proto-null-define

Conversation

@aduh95

@aduh95 aduh95 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

We have a lint rule for when the descriptor is a plain object, but it doesn't cover case where the descriptor is stored as a variable, and some instances were missing the null prototype.

As a reminder, setting __proto__: null is mandatory for property descriptor to avoid the code failing if e.g. both Object.prototype.value and Object.prototype.get are set to anything.

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net
  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jul 1, 2026
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jul 2, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 2, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment on lines +352 to +359

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.

Should we move this to internal/util? Looks like we're using it at least twice 🙂

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants