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
parent 89e951ef92
commit e8247ca5f4

View File

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