diff --git a/src/node_errors.h b/src/node_errors.h index f4f6e98814cea0..d333422ae8cd74 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -119,7 +119,11 @@ void OOMErrorHandler(const char* location, const v8::OOMDetails& details); std::string message = SPrintF(format, std::forward(args)...); \ v8::Local js_code = OneByteString(isolate, #code); \ v8::Local js_msg = \ - OneByteString(isolate, message.c_str(), message.length()); \ + v8::String::NewFromUtf8(isolate, \ + message.c_str(), \ + v8::NewStringType::kNormal, \ + message.length()) \ + .ToLocalChecked(); \ v8::Local e = v8::Exception::type(js_msg) \ ->ToObject(isolate->GetCurrentContext()) \ .ToLocalChecked(); \