Bug 1005156: Remove unused scope from WorkerScopes WrapGlobalObject(). rs=jst
authorNikhil Marathe <nsm.nikhil@gmail.com>
Fri, 02 May 2014 10:16:49 -0700
changeset 181810 d40ab96e7e2ec9e72fcfab743f2b446d93255b30
parent 181809 43c5be10eae0b874634fc6456a11ab4bec2d0f50
child 181811 079264ecb6786dc70918a3d07fde884f288f2c51
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersjst
bugs1005156
milestone32.0a1
Bug 1005156: Remove unused scope from WorkerScopes WrapGlobalObject(). rs=jst
dom/workers/WorkerScope.cpp
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -292,19 +292,16 @@ JSObject*
 DedicatedWorkerGlobalScope::WrapGlobalObject(JSContext* aCx)
 {
   mWorkerPrivate->AssertIsOnWorkerThread();
   MOZ_ASSERT(!mWorkerPrivate->IsSharedWorker());
 
   JS::CompartmentOptions options;
   mWorkerPrivate->CopyJSCompartmentOptions(options);
 
-  // We're wrapping the global, so the scope is undefined.
-  JS::Rooted<JSObject*> scope(aCx);
-
   return DedicatedWorkerGlobalScopeBinding_workers::Wrap(aCx, this, this,
                                                          options,
                                                          GetWorkerPrincipal());
 }
 
 void
 DedicatedWorkerGlobalScope::PostMessage(JSContext* aCx,
                                         JS::Handle<JS::Value> aMessage,
@@ -333,19 +330,16 @@ JSObject*
 SharedWorkerGlobalScope::WrapGlobalObject(JSContext* aCx)
 {
   mWorkerPrivate->AssertIsOnWorkerThread();
   MOZ_ASSERT(mWorkerPrivate->IsSharedWorker());
 
   JS::CompartmentOptions options;
   mWorkerPrivate->CopyJSCompartmentOptions(options);
 
-  // We're wrapping the global, so the scope is undefined.
-  JS::Rooted<JSObject*> scope(aCx);
-
   return SharedWorkerGlobalScopeBinding_workers::Wrap(aCx, this, this, options,
                                                       GetWorkerPrincipal());
 }
 
 bool
 GetterOnlyJSNative(JSContext* aCx, unsigned aArgc, JS::Value* aVp)
 {
   JS_ReportErrorNumber(aCx, js_GetErrorMessage, nullptr, JSMSG_GETTER_ONLY);