Bug 1464374 part 8 - Use GetRealmPrincipals in nsHTMLDocument::Open assertion. r=bz

This commit is contained in:
Jan de Mooij 2018-05-31 11:28:49 +02:00
Родитель 37e765587c
Коммит ad9d1f408f
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -1537,10 +1537,10 @@ nsHTMLDocument::Open(JSContext* cx,
SetReadyStateInternal(nsIDocument::READYSTATE_LOADING);
// After changing everything around, make sure that the principal on the
// document's compartment exactly matches NodePrincipal().
// document's realm exactly matches NodePrincipal().
DebugOnly<JSObject*> wrapper = GetWrapperPreserveColor();
MOZ_ASSERT_IF(wrapper,
JS_GetCompartmentPrincipals(js::GetObjectCompartment(wrapper)) ==
JS::GetRealmPrincipals(js::GetNonCCWObjectRealm(wrapper)) ==
nsJSPrincipals::get(NodePrincipal()));
return kungFuDeathGrip.forget();