Skip to content

lib: make validateInternalField() throw ERR_INVALID_THIS #58765

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

Closed
wants to merge 2 commits into from

Conversation

LiviaMedeiros
Copy link
Member

internal/validators.validateInternalField() has no other purpose than to validate this value.
It must throw ERR_INVALID_THIS rather than ERR_INVALID_ARG_TYPE, and ideally have more appropriate name (used validateThisInternalField).

@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 Jun 19, 2025
Copy link

codecov bot commented Jun 19, 2025

Codecov Report

Attention: Patch coverage is 98.73418% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.12%. Comparing base (5584cc5) to head (4cba46d).
Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/perf/performance_entry.js 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58765      +/-   ##
==========================================
- Coverage   90.13%   90.12%   -0.02%     
==========================================
  Files         639      639              
  Lines      188192   188199       +7     
  Branches    36916    36916              
==========================================
- Hits       169633   169617      -16     
+ Misses      11324    11322       -2     
- Partials     7235     7260      +25     
Files with missing lines Coverage Δ
lib/internal/errors.js 97.50% <100.00%> (ø)
lib/internal/event_target.js 99.15% <100.00%> (ø)
lib/internal/perf/observe.js 91.55% <100.00%> (ø)
lib/internal/perf/performance.js 93.49% <100.00%> (ø)
lib/internal/perf/resource_timing.js 99.62% <100.00%> (ø)
lib/internal/perf/usertiming.js 94.14% <100.00%> (ø)
lib/internal/validators.js 98.16% <100.00%> (+0.01%) ⬆️
lib/internal/vm/module.js 98.31% <100.00%> (ø)
lib/internal/perf/performance_entry.js 90.00% <87.50%> (ø)

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LiviaMedeiros LiviaMedeiros added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 19, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 19, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@LiviaMedeiros LiviaMedeiros added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 21, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 21, 2025
@nodejs-github-bot
Copy link
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/67597/

@nodejs-github-bot
Copy link
Collaborator

@LiviaMedeiros LiviaMedeiros added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 23, 2025
@LiviaMedeiros LiviaMedeiros added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 24, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 24, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/58765
✔  Done loading data for nodejs/node/pull/58765
----------------------------------- PR info ------------------------------------
Title      lib: make `validateInternalField()` throw `ERR_INVALID_THIS` (#58765)
Author     Livia Medeiros <livia@cirno.name> (@LiviaMedeiros)
Branch     LiviaMedeiros:lib-validate-this -> nodejs:main
Labels     lib / src, author ready, needs-ci
Commits    2
 - lib: make `validateInternalField()` throw `ERR_INVALID_THIS`
 - lib: rename `validateInternalField` into `validateThisInternalField`
Committers 1
 - LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 19 Jun 2025 12:47:26 GMT
   ✔  Approvals: 3
   ✔  - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/58765#pullrequestreview-2942922771
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/58765#pullrequestreview-2947030717
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/58765#pullrequestreview-2947854120
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2025-06-22T08:41:22Z: https://ci.nodejs.org/job/node-test-pull-request/67608/
- Querying data for job/node-test-pull-request/67608/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 58765
From https://github.com/nodejs/node
 * branch                  refs/pull/58765/merge -> FETCH_HEAD
✔  Fetched commits as 745f48d9f36b..4cba46dad12b
--------------------------------------------------------------------------------
[main 938b8926de] lib: make `validateInternalField()` throw `ERR_INVALID_THIS`
 Author: LiviaMedeiros <livia@cirno.name>
 Date: Thu Jun 19 20:03:15 2025 +0800
 5 files changed, 13 insertions(+), 18 deletions(-)
[main f8ef96a2d9] lib: rename `validateInternalField` into `validateThisInternalField`
 Author: LiviaMedeiros <livia@cirno.name>
 Date: Thu Jun 19 20:23:51 2025 +0800
 8 files changed, 70 insertions(+), 70 deletions(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
lib: make `validateInternalField()` throw `ERR_INVALID_THIS`

PR-URL: #58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD 2283d47253] lib: make validateInternalField() throw ERR_INVALID_THIS
Author: LiviaMedeiros <livia@cirno.name>
Date: Thu Jun 19 20:03:15 2025 +0800
5 files changed, 13 insertions(+), 18 deletions(-)
Rebasing (3/4)
Rebasing (4/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
lib: rename validateInternalField into validateThisInternalField

PR-URL: #58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD 2fbdd2ac2a] lib: rename validateInternalField into validateThisInternalField
Author: LiviaMedeiros <livia@cirno.name>
Date: Thu Jun 19 20:23:51 2025 +0800
8 files changed, 70 insertions(+), 70 deletions(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/15840563873

@LiviaMedeiros LiviaMedeiros added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jun 24, 2025
jasnell pushed a commit that referenced this pull request Jun 24, 2025
PR-URL: #58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell pushed a commit that referenced this pull request Jun 24, 2025
PR-URL: #58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Jun 24, 2025

Landed in 745f48d...6145ba7

@jasnell jasnell closed this Jun 24, 2025
@LiviaMedeiros LiviaMedeiros removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 24, 2025
RafaelGSS pushed a commit that referenced this pull request Jun 24, 2025
PR-URL: #58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Jun 24, 2025
PR-URL: #58765
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
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-rebase Add this label to allow the Commit Queue to land a PR in several commits. 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