Skip to content

fs: Fix default params for fs.write

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

fs

Description of change

Add support for fs.write(fd, buffer, cb) and fs.write(fd, buffer, offset, cb) as documented at https://nodejs.org/api/fs.html#fs_fs_write_fd_data_position_encoding_callback (it says that data can be either a string or a Buffer).

Update: Extended to apply to fs.writeSync as well, which turned out to have the same issue (#7879 (closed)).

Merge request reports

Loading