diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 6f54a4d2bc46..6ea601b8fea3 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2563,7 +2563,7 @@ AsmJSCacheOpenEntryForRead(JS::Handle aGlobal, intptr_t *aHandle) { nsIPrincipal* principal = - nsJSPrincipals::get(JS_GetCompartmentPrincipals(js::GetObjectCompartment(aGlobal))); + nsJSPrincipals::get(JS::GetRealmPrincipals(js::GetNonCCWObjectRealm(aGlobal))); return asmjscache::OpenEntryForRead(principal, aBegin, aLimit, aSize, aMemory, aHandle); } @@ -2577,7 +2577,7 @@ AsmJSCacheOpenEntryForWrite(JS::Handle aGlobal, intptr_t* aHandle) { nsIPrincipal* principal = - nsJSPrincipals::get(JS_GetCompartmentPrincipals(js::GetObjectCompartment(aGlobal))); + nsJSPrincipals::get(JS::GetRealmPrincipals(js::GetNonCCWObjectRealm(aGlobal))); return asmjscache::OpenEntryForWrite(principal, aBegin, aEnd, aSize, aMemory, aHandle); }