Commit 3459ad5
committed
vfs: use async handlers in callback/promise paths with DRY utilities
Convert VFS callback and promise code paths from calling sync handler
methods to async handlers that return undefined (not handled) or a
Promise (VFS handles it). This removes sync method calls from async
code paths, making VFS safe for custom providers that do real I/O.
Add DRY utilities (vfsRead, vfsOp, vfsOpVoid in setup.js and
vfsResult, vfsVoid in fs.js) to eliminate repeated boilerplate across
~80 handler methods and ~40 fs functions. Add missing promises methods
(chmod, chown, lchown, utimes, lutimes, open, lchmod) to
file_system.js. Fix bugs where chown/lchown/lutimes async handlers
called wrong sync methods. Fix invalid package.json handling to
gracefully fall through in CJS context instead of throwing.1 parent b047092 commit 3459ad5
5 files changed
Lines changed: 289 additions & 734 deletions
File tree
- lib
- internal
- fs
- vfs
- test/parallel
0 commit comments