Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ee0a98b

Browse filesBrowse files
joyeecheungtargos
authored andcommitted
src: decode native error messages as UTF-8
The native error messages can sometimes contain e.g. path content that are typically passed in as chars with UTF8-encoded code points. The native error throwing code previously always decode the chars as Latin-1, which would be incorrect. PR-URL: #55024 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent e879c5e commit ee0a98b
Copy full SHA for ee0a98b

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎src/node_errors.h‎

Copy file name to clipboardExpand all lines: src/node_errors.h
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ void OOMErrorHandler(const char* location, const v8::OOMDetails& details);
119119
std::string message = SPrintF(format, std::forward<Args>(args)...); \
120120
v8::Local<v8::String> js_code = OneByteString(isolate, #code); \
121121
v8::Local<v8::String> js_msg = \
122-
OneByteString(isolate, message.c_str(), message.length()); \
122+
v8::String::NewFromUtf8(isolate, \
123+
message.c_str(), \
124+
v8::NewStringType::kNormal, \
125+
message.length()) \
126+
.ToLocalChecked(); \
123127
v8::Local<v8::Object> e = v8::Exception::type(js_msg) \
124128
->ToObject(isolate->GetCurrentContext()) \
125129
.ToLocalChecked(); \

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.