Bug 1241349 part 4. Start using binding_detail::UnprivilegedJunkScopeOrWorkerGlobal in maplike/setlike code. r=bholley

This commit is contained in:
Boris Zbarsky 2016-02-10 23:31:33 -05:00
Родитель b0e7faec5a
Коммит e25e4580b2
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -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);