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-10-17 00:48:26 +02:00
2020-10-17 00:48:26 +02:00
2021-08-25 07:55:32 -07:00
2021-04-24 16:34:58 +02:00
2020-10-17 00:48:26 +02:00
2020-10-17 00:48:26 +02:00
2020-10-17 00:48:26 +02:00
2021-05-06 10:39:23 -07:00
2020-10-17 00:48:26 +02:00
2020-12-29 15:49:09 +00:00
2020-10-17 00:48:26 +02:00
2020-06-30 22:36:50 +02:00
2020-10-17 00:48:26 +02:00
2020-04-06 01:53:54 +02:00
2020-04-06 01:53:54 +02:00
2020-03-19 10:56:45 +01:00