diff --git a/src/node_errors.h b/src/node_errors.h index ee99e2caf3c5f9..ac07b96b5cad0f 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -112,7 +112,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(); \