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

src: fix fs.write() externalized string handling #18216

Merged
merged 2 commits into from
Jan 23, 2018

Commits on Jan 23, 2018

  1. build: define NOMINMAX on windows

    Build with `-DNOMINMAX` to stop `<windows.h>` from defining macros that
    conflict with `std::min()` and `std::max()`.
    
    PR-URL: nodejs#18216
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    bnoordhuis committed Jan 23, 2018
    Configuration menu
    Copy the full SHA
    0b1841d View commit details
    Browse the repository at this point in the history
  2. 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: nodejs#18146
    PR-URL: nodejs#18216
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    bnoordhuis committed Jan 23, 2018
    Configuration menu
    Copy the full SHA
    b2b9d11 View commit details
    Browse the repository at this point in the history