Skip to content

fs: throw ERR_INVALID_THIS on illegal invocations - #58848

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
LiviaMedeiros:fs-throw-invalid-this
Jun 28, 2025
Merged

fs: throw ERR_INVALID_THIS on illegal invocations#58848
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
LiviaMedeiros:fs-throw-invalid-this

Conversation

@LiviaMedeiros

Copy link
Copy Markdown
Member

This PR makes Dir.prototype.path, ReadStream.prototype.autoClose, and WriteStream.prototype.autoClose getters and setters throw ERR_INVALID_THIS instead of failing with internal implementation-specific messages when called on invalid this.

@nodejs-github-botnodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Jun 26, 2025
@codecov

codecovBot commented Jun 26, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.09%. Comparing base (faada65) to head (818f292).
Report is 28 commits behind head on main.

Files with missing linesPatch %Lines
lib/internal/fs/streams.js60.00%2 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #58848 +/- ##
==========================================
- Coverage 90.09% 90.09% -0.01% 
==========================================
Files 640 640 Lines 188271 188454 +183 Branches 36923 36969 +46 ==========================================
+ Hits 169625 169788 +163 + Misses 11386 11366 -20 - Partials 7260 7300 +40 
Files with missing linesCoverage Δ
lib/internal/fs/dir.js94.49% <100.00%> (+0.04%)⬆️
lib/internal/fs/streams.js93.21% <60.00%> (-0.30%)⬇️

... and 49 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.

@LiviaMedeirosLiviaMedeiros added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 26, 2025
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 26, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@LiviaMedeirosLiviaMedeiros added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 26, 2025
@aduh95aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 28, 2025
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 28, 2025
@nodejs-github-bot
nodejs-github-bot merged commit d824914 into nodejs:mainJun 28, 2025
73 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in d824914

targos pushed a commit that referenced this pull request Jul 3, 2025
PR-URL: #58848
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 21, 2025
PR-URL: #58848
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 24, 2025
PR-URL: #58848
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
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.fsIssues and PRs related to the fs subsystem / file system.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@LiviaMedeiros@nodejs-github-bot@lpinca@juanarbol@aduh95