From 665fdbc3476e4c94aedf7daa58bc7c5361e7a460 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Tue, 15 Sep 2020 13:46:21 +0800 Subject: [PATCH] src: replace deprecate v8 api for string --- 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 247c1c530428..018f0231dbd1 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1937,7 +1937,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());