MCPcopy Index your code
hub / github.com/nodejs/node / runWithInvalidFD

Function runWithInvalidFD

test/common/index.js:822–833  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

820}
821
822function runWithInvalidFD(func) {
823 let fd = 1 << 30;
824 // Get first known bad file descriptor. 1 << 30 is usually unlikely to
825 // be an valid one.
826 try {
827 while (fs.fstatSync(fd--) && fd > 0);
828 } catch {
829 return func(fd);
830 }
831
832 printSkipMessage('Could not generate an invalid fd');
833}
834
835// A helper function to simplify checking for ERR_INVALID_ARG_TYPE output.
836function invalidArgTypeHelper(input) {

Callers

nothing calls this directly

Calls 3

printSkipMessageFunction · 0.85
fstatSyncMethod · 0.80
funcFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…