From 6f9cbcf6a6645752d5bdedab2bdccea5d458110d Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Tue, 15 Sep 2020 16:46:53 +0800 Subject: [PATCH] src: fix v8 api deprecation PR-URL: https://github.com/nodejs/node/pull/35700 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Matteo Collina Reviewed-By: Jiawen Geng Reviewed-By: Shelley Vohr --- src/node_file.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_file.cc b/src/node_file.cc index de5c455c7a2..a2fb9e0b461 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1944,7 +1944,7 @@ static void WriteString(const FunctionCallbackInfo& args) { auto ext = string->GetExternalOneByteStringResource(); buf = const_cast(ext->data()); len = ext->length(); - } else if (enc == UCS2 && IsLittleEndian() && string->IsExternal()) { + } else if (enc == UCS2 && IsLittleEndian() && string->IsExternalTwoByte()) { auto ext = string->GetExternalStringResource(); buf = reinterpret_cast(const_cast(ext->data())); len = ext->length() * sizeof(*ext->data());