mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset f78470faff8e (bug 1034627) Valgrind Test failures on a CLOSED TREE
This commit is contained in:
parent
8d5ad53d61
commit
6f8c5db933
@ -557,10 +557,9 @@ nsXPCComponents_InterfacesByID::NewResolve(nsIXPConnectWrappedNative *wrapper,
|
||||
if (38 != JS_GetStringLength(str))
|
||||
return NS_OK;
|
||||
|
||||
JSAutoByteString utf8str;
|
||||
if (utf8str.encodeUtf8(cx, str)) {
|
||||
if (const jschar *name = JS_GetInternedStringChars(str)) {
|
||||
nsID iid;
|
||||
if (!iid.Parse(utf8str.ptr()))
|
||||
if (!iid.Parse(NS_ConvertUTF16toUTF8(name).get()))
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIInterfaceInfo> info;
|
||||
@ -2606,12 +2605,13 @@ nsXPCComponents_Utils::ReportError(HandleValue error, JSContext *cx)
|
||||
frame->GetLineNumber(&lineNo);
|
||||
}
|
||||
|
||||
nsAutoJSString msg;
|
||||
if (!msg.init(cx, msgstr))
|
||||
const jschar *msgchars = JS_GetStringCharsZ(cx, msgstr);
|
||||
if (!msgchars)
|
||||
return NS_OK;
|
||||
|
||||
nsresult rv = scripterr->InitWithWindowID(
|
||||
msg, fileName, EmptyString(), lineNo, 0, 0,
|
||||
nsDependentString(static_cast<const char16_t *>(msgchars)),
|
||||
fileName, EmptyString(), lineNo, 0, 0,
|
||||
"XPConnect JavaScript", innerWindowID);
|
||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||
|
||||
|
@ -368,12 +368,13 @@ nsXPCWrappedJSClass::BuildPropertyEnumerator(XPCCallContext& ccx,
|
||||
if (!name)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsAutoJSString autoStr;
|
||||
if (!autoStr.init(cx, name))
|
||||
size_t length;
|
||||
const jschar *chars = JS_GetStringCharsAndLength(cx, name, &length);
|
||||
if (!chars)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIProperty> property =
|
||||
new xpcProperty(autoStr.get(), (uint32_t)autoStr.Length(), value);
|
||||
new xpcProperty(chars, (uint32_t) length, value);
|
||||
|
||||
if (!propertyArray.AppendObject(property))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user