diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 31f31d31f37a..b5d9af820390 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -5702,7 +5702,7 @@ WorkerPrivate::NotifyInternal(JSContext* aCx, Status aStatus) // If the worker script never ran, or failed to compile, we don't need to do // anything else, except pretend that we ran the close handler. - if (!JS::CurrentGlobalOrNull(aCx)) { + if (!GlobalScope()) { mCloseHandlerStarted = true; mCloseHandlerFinished = true; return true;