Unverified Commit b67bf38f authored by Ben Noordhuis's avatar Ben Noordhuis Committed by Beth Griggs
Browse files

src: fix fs.write() externalized string handling

* Respect `encoding` argument when the string is externalized.

* Copy the string when the write request can outlive the externalized
  string.

This commit removes `StringBytes::GetExternalParts()` because it is
fundamentally broken.

Fixes: https://github.com/nodejs/node/issues/18146
Fixes: https://github.com/nodejs/node/issues/22728
Backport-PR-URL: https://github.com/nodejs/node/pull/22731
PR-URL: https://github.com/nodejs/node/pull/18216



Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent ca8d4e34
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment