We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9ce4b4 commit 6f9cbcfCopy full SHA for 6f9cbcf
src/node_file.cc
@@ -1944,7 +1944,7 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
1944
auto ext = string->GetExternalOneByteStringResource();
1945
buf = const_cast<char*>(ext->data());
1946
len = ext->length();
1947
- } else if (enc == UCS2 && IsLittleEndian() && string->IsExternal()) {
+ } else if (enc == UCS2 && IsLittleEndian() && string->IsExternalTwoByte()) {
1948
auto ext = string->GetExternalStringResource();
1949
buf = reinterpret_cast<char*>(const_cast<uint16_t*>(ext->data()));
1950
len = ext->length() * sizeof(*ext->data());
0 commit comments