-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
fs: expose FileHandle class and add isFileHandle method #61650
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61650 +/- ##
==========================================
- Coverage 89.74% 89.73% -0.02%
==========================================
Files 674 674
Lines 204348 204381 +33
Branches 39271 39270 -1
==========================================
+ Hits 183396 183401 +5
- Misses 13262 13296 +34
+ Partials 7690 7684 -6
🚀 New features to boost your workflow:
|
|
the Ci failure on macos is because of a recent commit that increased the debugger timeout on macOS from 10s to 15s due to known timing issues. The error shows it's still timing out at 15s, suggesting the flakiness persists. Commit Details: amol@Amols-MBP node % git show 2bda7cbfb62
commit 2bda7cbfb62778bd793fbceaa9a5a907c3d344be
Author: Chengzhong Wu <[email protected]>
Date: Fri Oct 24 10:21:32 2025 -0400
test: increase debugger waitFor timeout on macOS
PR-URL: https://github.com/nodejs/node/pull/60367
Refs: https://github.com/nodejs/node/actions/runs/18694915575/job/53309761263?pr=60343
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
diff --git a/test/common/debugger.js b/test/common/debugger.js
index 1a258913e00..f5a47cbe06e 100644
--- a/test/common/debugger.js
+++ b/test/common/debugger.js
@@ -7,12 +7,10 @@ const BREAK_MESSAGE = new RegExp('(?:' + [
'exception', 'other', 'promiseRejection', 'step',
].join('|') + ') in', 'i');
-// Some macOS machines require more time to receive the outputs from the client.
let TIMEOUT = common.platformTimeout(10000);
-if (common.isWindows) {
- // Some of the windows machines in the CI need more time to receive
- // the outputs from the client.
- // https://github.com/nodejs/build/issues/3014
+// Some macOS and Windows machines require more time to receive the outputs from the client.
+// https://github.com/nodejs/build/issues/3014
+if (common.isWindows || common.isMacOS) {
TIMEOUT = common.platformTimeout(15000);
} |
|
> require('vm').runInNewContext('[]') instanceof Array
false |
i have seen there is a pattern in nodejs classes and i will update my function to follow it! thank you |
…y using private symbols instead of instanceof
This PR exposes the
FileHandleclass innode:fsandnode:fs/promises, allowing developers to reliably check if an object is a file handle usinginstanceofor the new static helper method. Previously,FileHandlewas hidden, forcing developers to rely on "duck typing" (checking for.fdand.closeproperties), which is unreliable.Changes:
FileHandleinlib/internal/fs/promises.js.FileHandleinlib/fs.js.FileHandle.isFileHandle(value)method.test/parallel/test-fs-filehandle-accessibility.js.Fixes: #61637