mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 932025: Don't use Maybe<AutoCompartment> in OldDebugAPI.cpp, to avoid dumb G++ warnings. r=sfink
This commit is contained in:
parent
8c189cbe06
commit
01e68ba41d
@ -1029,11 +1029,19 @@ FormatValue(JSContext *cx, const Value &vArg, JSAutoByteString &bytes)
|
||||
{
|
||||
RootedValue v(cx, vArg);
|
||||
|
||||
mozilla::Maybe<AutoCompartment> ac;
|
||||
if (v.isObject())
|
||||
ac.construct(cx, &v.toObject());
|
||||
/*
|
||||
* We could use Maybe<AutoCompartment> here, but G++ can't quite follow
|
||||
* that, and warns about uninitialized members being used in the
|
||||
* destructor.
|
||||
*/
|
||||
RootedString str(cx);
|
||||
if (v.isObject()) {
|
||||
AutoCompartment ac(cx, &v.toObject());
|
||||
str = ToString<CanGC>(cx, v);
|
||||
} else {
|
||||
str = ToString<CanGC>(cx, v);
|
||||
}
|
||||
|
||||
JSString *str = ToString<CanGC>(cx, v);
|
||||
if (!str)
|
||||
return nullptr;
|
||||
const char *buf = bytes.encodeLatin1(cx, str);
|
||||
|
Loading…
Reference in New Issue
Block a user