mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 813278 - Overload JSAutoCompartment for TimeZoneSettingObserver - r=luke
This commit is contained in:
parent
060f9c47ea
commit
a6216d9879
@ -82,7 +82,7 @@ public:
|
||||
// Set the system timezone based on the current settings.
|
||||
if (aResult.isString()) {
|
||||
JSAutoRequest ar(cx);
|
||||
JSAutoCompartment ac(cx, JSVAL_TO_OBJECT(aResult));
|
||||
JSAutoCompartment ac(cx, aResult.toString());
|
||||
return TimeZoneSettingObserver::SetTimeZone(aResult, cx);
|
||||
}
|
||||
|
||||
|
@ -1488,6 +1488,14 @@ JSAutoCompartment::JSAutoCompartment(JSContext *cx, JSStackFrame *target)
|
||||
cx_->enterCompartment(Valueify(target)->global().compartment());
|
||||
}
|
||||
|
||||
JSAutoCompartment::JSAutoCompartment(JSContext *cx, JSString *target)
|
||||
: cx_(cx),
|
||||
oldCompartment_(cx->compartment)
|
||||
{
|
||||
AssertHeapIsIdleOrIterating(cx_);
|
||||
cx_->enterCompartment(target->compartment());
|
||||
}
|
||||
|
||||
JSAutoCompartment::~JSAutoCompartment()
|
||||
{
|
||||
cx_->leaveCompartment(oldCompartment_);
|
||||
|
@ -3156,6 +3156,7 @@ class JS_PUBLIC_API(JSAutoCompartment)
|
||||
JSAutoCompartment(JSContext *cx, JSRawObject target);
|
||||
JSAutoCompartment(JSContext *cx, JSScript *target);
|
||||
JSAutoCompartment(JSContext *cx, JSStackFrame *target);
|
||||
JSAutoCompartment(JSContext *cx, JSString *target);
|
||||
~JSAutoCompartment();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user