Bug 1287776 - eliminate assignment from MOZ_ASSERT in EnsureContentXBLScope. r?bholley
MozReview-Commit-ID: 47a4XSAiQRP
--- a/js/xpconnect/src/XPCWrappedNativeScope.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp
@@ -287,21 +287,20 @@ XPCWrappedNativeScope::EnsureContentXBLS
SandboxOptions options;
options.wantXrays = false;
options.wantComponents = true;
options.proto = global;
options.sameZoneAs = global;
// Use an nsExpandedPrincipal to create asymmetric security.
nsIPrincipal* principal = GetPrincipal();
- nsCOMPtr<nsIExpandedPrincipal> ep;
- MOZ_ASSERT(!(ep = do_QueryInterface(principal)));
+ MOZ_ASSERT(!nsContentUtils::IsExpandedPrincipal(principal));
nsTArray< nsCOMPtr<nsIPrincipal> > principalAsArray(1);
principalAsArray.AppendElement(principal);
- ep = new nsExpandedPrincipal(principalAsArray);
+ nsCOMPtr<nsIExpandedPrincipal> ep = new nsExpandedPrincipal(principalAsArray);
// Create the sandbox.
RootedValue v(cx);
nsresult rv = CreateSandboxObject(cx, &v, ep, options);
NS_ENSURE_SUCCESS(rv, nullptr);
mContentXBLScope = &v.toObject();
// Tag it.