зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1241349 part 4. Start using binding_detail::UnprivilegedJunkScopeOrWorkerGlobal in maplike/setlike code. r=bholley
This commit is contained in:
Родитель
b0e7faec5a
Коммит
e25e4580b2
|
@ -15688,7 +15688,10 @@ class CGMaplikeOrSetlikeHelperFunctionGenerator(CallbackMember):
|
|||
jsapi.Init();
|
||||
jsapi.TakeOwnershipOfErrorReporting();
|
||||
JSContext* cx = jsapi.cx();
|
||||
JSAutoCompartment tempCompartment(cx, xpc::UnprivilegedJunkScope());
|
||||
// It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because
|
||||
// all we want is to wrap into _some_ scope and then unwrap to find
|
||||
// the reflector, and wrapping has no side-effects.
|
||||
JSAutoCompartment tempCompartment(cx, binding_detail::UnprivilegedJunkScopeOrWorkerGlobal());
|
||||
JS::Rooted<JS::Value> v(cx);
|
||||
if(!ToJSValue(cx, self, &v)) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
|
|
Загрузка…
Ссылка в новой задаче