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:James M Snell <jasnell@gmail.com>
parent
ca8d4e34
Please register or sign in to comment