Skip to content

fs: throw ERR_INVALID_THIS on illegal invocations #58848

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

Merged
merged 1 commit into from
Jun 28, 2025

Conversation

LiviaMedeiros
Copy link
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-bot nodejs-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
Copy link

codecov bot commented Jun 26, 2025

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 lines Patch % Lines
lib/internal/fs/streams.js 60.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 lines Coverage Δ
lib/internal/fs/dir.js 94.49% <100.00%> (+0.04%) ⬆️
lib/internal/fs/streams.js 93.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.

@LiviaMedeiros LiviaMedeiros added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 26, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 26, 2025
@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 26, 2025
@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 28, 2025
@nodejs-github-bot nodejs-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:main Jun 28, 2025
73 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in d824914

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. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants