diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index c17b943635d0..38ea3d7079fe 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -3059,7 +3059,7 @@ nsGlobalWindowInner::DoResolve(JSContext* aCx, JS::Handle aObj, clazz = &ControllersShimClass; } MOZ_ASSERT(JS_IsGlobalObject(aObj)); - JS::Rooted shim(cx, JS_NewObject(cx, clazz)); + JS::Rooted shim(aCx, JS_NewObject(aCx, clazz)); if (NS_WARN_IF(!shim)) { return false; }