Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v14.x backport] fs: fix write methods param validation and docs #42603

Closed
wants to merge 2 commits into from

Commits on Apr 4, 2022

  1. doc: fix documentation of FileHandle.prototype.appendFile

    PR-URL: nodejs#42588
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Darshan Sen <raisinten@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Mestery <mestery@protonmail.com>
    aduh95 committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    808e8b1 View commit details
    Browse the repository at this point in the history
  2. 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: nodejs#34993
    PR-URL: nodejs#41677
    Refs: nodejs#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>
    LiviaMedeiros authored and aduh95 committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    18ac4af View commit details
    Browse the repository at this point in the history