Files
Livia Medeiros 8009cb0a78 fs: fix write methods param validation and docs
The FS docs wrongfully indicated support for passing object with an own
`toString` function property to `FileHandle.prototype.appendFile`,
`FileHandle.prototype.writeFile`, `FileHandle.prototype.write`,
`fsPromises.writeFile`, and `fs.writeSync`. This commit fixes that, and
adds some test to ensure the actual behavior is aligned with the docs.
It also fixes a bug that makes the process crash if a non-buffer object
was passed to `FileHandle.prototype.write`.

Refs: https://github.com/nodejs/node/pull/34993
PR-URL: https://github.com/nodejs/node/pull/41677
Backport-PR-URL: https://github.com/nodejs/node/pull/42631
Refs: https://github.com/nodejs/node/issues/41666
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-04-07 00:20:46 -05:00
..
2020-05-24 03:26:21 +02:00
2020-02-18 22:15:50 -08:00
2022-02-07 12:33:44 -05:00
2020-10-21 01:26:34 +02:00
2021-09-16 09:44:12 -04:00
2022-04-06 12:25:51 -05:00
2022-04-06 12:20:11 -05:00
2022-04-06 12:25:54 -05:00
2021-11-21 16:07:35 +01:00
2021-04-30 10:59:28 -07:00
2022-03-07 17:23:21 +00:00
2022-03-07 17:31:47 +00:00
2021-07-07 14:50:47 +02:00
2021-06-26 16:31:30 +02:00