Bug 1473865 part 1 - Remove unused nsJSUtils::GetStaticScriptContext. r=bz
authorJan de Mooij <jdemooij@mozilla.com>
Mon, 09 Jul 2018 12:26:39 +0200
changeset 815595 33dd027449633b0031acea1440a1f336cec9ae56
parent 815594 4ff5720cadae8374a02409f63364b46984370865
child 815596 bf38bf7d87c6543c350f7a3a2d29f67e07188171
push id115563
push userbmo:ntim.bugs@gmail.com
push dateMon, 09 Jul 2018 12:45:57 +0000
reviewersbz
bugs1473865
milestone63.0a1
Bug 1473865 part 1 - Remove unused nsJSUtils::GetStaticScriptContext. r=bz
dom/base/nsJSUtils.cpp
dom/base/nsJSUtils.h
--- a/dom/base/nsJSUtils.cpp
+++ b/dom/base/nsJSUtils.cpp
@@ -65,26 +65,16 @@ nsJSUtils::GetCallingLocation(JSContext*
 nsIScriptGlobalObject *
 nsJSUtils::GetStaticScriptGlobal(JSObject* aObj)
 {
   if (!aObj)
     return nullptr;
   return xpc::WindowGlobalOrNull(aObj);
 }
 
-nsIScriptContext *
-nsJSUtils::GetStaticScriptContext(JSObject* aObj)
-{
-  nsIScriptGlobalObject *nativeGlobal = GetStaticScriptGlobal(aObj);
-  if (!nativeGlobal)
-    return nullptr;
-
-  return nativeGlobal->GetScriptContext();
-}
-
 uint64_t
 nsJSUtils::GetCurrentlyRunningCodeInnerWindowID(JSContext *aContext)
 {
   if (!aContext)
     return 0;
 
   nsGlobalWindowInner* win = xpc::CurrentWindowOrNull(aContext);
   return win ? win->WindowID() : 0;
--- a/dom/base/nsJSUtils.h
+++ b/dom/base/nsJSUtils.h
@@ -41,18 +41,16 @@ public:
                                  uint32_t* aLineno = nullptr,
                                  uint32_t* aColumn = nullptr);
   static bool GetCallingLocation(JSContext* aContext, nsAString& aFilename,
                                  uint32_t* aLineno = nullptr,
                                  uint32_t* aColumn = nullptr);
 
   static nsIScriptGlobalObject *GetStaticScriptGlobal(JSObject* aObj);
 
-  static nsIScriptContext *GetStaticScriptContext(JSObject* aObj);
-
   /**
    * Retrieve the inner window ID based on the given JSContext.
    *
    * @param JSContext aContext
    *        The JSContext from which you want to find the inner window ID.
    *
    * @returns uint64_t the inner window ID.
    */