Browse Source

src: remove misleading flag in TwoByteValue

String::REPLACE_INVALID_UTF8 is only applied in V8's
String::WriteUtf8() (i.e. Utf8Value).

PR-URL: https://github.com/nodejs/node/pull/11436
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Timothy Gu 8 years ago
parent
commit
a7f7724167
  1. 3
      src/util.cc

3
src/util.cc

@ -48,8 +48,7 @@ TwoByteValue::TwoByteValue(Isolate* isolate, Local<Value> value) {
const size_t storage = string->Length() + 1; const size_t storage = string->Length() + 1;
AllocateSufficientStorage(storage); AllocateSufficientStorage(storage);
const int flags = const int flags = String::NO_NULL_TERMINATION;
String::NO_NULL_TERMINATION | String::REPLACE_INVALID_UTF8;
const int length = string->Write(out(), 0, storage, flags); const int length = string->Write(out(), 0, storage, flags);
SetLengthAndZeroTerminate(length); SetLengthAndZeroTerminate(length);
} }

Loading…
Cancel
Save