mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 811911 - Use UTF-8 output for TwoByte chars in Error objects; r=jandem
This commit is contained in:
parent
ffcec0c82a
commit
ea3c382dcb
@ -696,7 +696,6 @@ ErrorReport::init(JSContext* cx, HandleValue exn)
|
||||
UniqueChars addonIdChars(JS_EncodeString(cx, addonId));
|
||||
|
||||
const char* filename = nullptr;
|
||||
|
||||
if (reportp && reportp->filename) {
|
||||
filename = strrchr(reportp->filename, '/');
|
||||
if (filename)
|
||||
@ -775,9 +774,9 @@ ErrorReport::init(JSContext* cx, HandleValue exn)
|
||||
}
|
||||
|
||||
if (JS_GetProperty(cx, exnObject, filename_str, &val)) {
|
||||
JSString* tmp = ToString<CanGC>(cx, val);
|
||||
RootedString tmp(cx, ToString<CanGC>(cx, val));
|
||||
if (tmp)
|
||||
filename.encodeLatin1(cx, tmp);
|
||||
filename.encodeUtf8(cx, tmp);
|
||||
else
|
||||
cx->clearPendingException();
|
||||
} else {
|
||||
@ -820,7 +819,7 @@ ErrorReport::init(JSContext* cx, HandleValue exn)
|
||||
}
|
||||
|
||||
if (str)
|
||||
message_ = bytesStorage.encodeLatin1(cx, str);
|
||||
message_ = bytesStorage.encodeUtf8(cx, str);
|
||||
if (!message_)
|
||||
message_ = "unknown (can't convert to string)";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user