Bug 848395 - GC: Move Rooted to JS namespace - rename js::Rooted to JS::Rooted outside SpiderMonkey r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 06 Mar 2013 16:41:43 +0000
changeset 124126 0d3f5942d825d1345e33fa68473c2329d5aa74d8
parent 124125 e9dca222d6c3aa1f4311dbac73769c3e9bd1be90
child 124127 05113da6e613f75d59884b23d7d91f2bfd64641b
push id24408
push userryanvm@gmail.com
push dateFri, 08 Mar 2013 04:58:11 +0000
treeherdermozilla-central@cb432984d5ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs848395
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 848395 - GC: Move Rooted to JS namespace - rename js::Rooted to JS::Rooted outside SpiderMonkey r=terrence
content/base/src/nsFrameMessageManager.cpp
content/events/src/nsEventListenerManager.cpp
content/xbl/src/nsXBLBinding.cpp
content/xbl/src/nsXBLProtoImplField.cpp
content/xbl/src/nsXBLProtoImplMethod.cpp
content/xbl/src/nsXBLProtoImplProperty.cpp
content/xbl/src/nsXBLPrototypeHandler.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsJSEnvironment.cpp
dom/base/nsScreen.cpp
dom/bindings/BindingDeclarations.h
dom/bindings/BindingUtils.h
dom/bindings/Codegen.py
dom/indexedDB/KeyPath.cpp
dom/src/json/nsJSON.cpp
dom/workers/ScriptLoader.cpp
dom/workers/WorkerPrivate.cpp
extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
ipc/testshell/XPCShellEnvironment.cpp
js/ipc/ObjectWrapperParent.cpp
js/jsd/jsd_stak.cpp
js/jsd/jsd_step.cpp
js/jsd/jsd_xpc.cpp
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/loader/mozJSSubScriptLoader.cpp
js/xpconnect/shell/xpcshell.cpp
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCDebug.cpp
js/xpconnect/src/XPCQuickStubs.h
js/xpconnect/src/XPCRuntimeService.cpp
js/xpconnect/wrappers/XrayWrapper.cpp
netwerk/base/src/ProxyAutoConfig.cpp
--- a/content/base/src/nsFrameMessageManager.cpp
+++ b/content/base/src/nsFrameMessageManager.cpp
@@ -1079,17 +1079,17 @@ nsFrameScriptExecutor::TryCacheLoadAndCo
       JSObject* global = nullptr;
       mGlobal->GetJSObject(&global);
       if (global) {
         JSAutoCompartment ac(mCx, global);
         JS::CompileOptions options(mCx);
         options.setNoScriptRval(true)
                .setFileAndLine(url.get(), 1)
                .setPrincipals(nsJSPrincipals::get(mPrincipal));
-        js::RootedObject empty(mCx, NULL);
+        JS::RootedObject empty(mCx, NULL);
         JSScript* script = JS::Compile(mCx, empty, options,
                                        dataString.get(), dataString.Length());
 
         if (script) {
           nsAutoCString scheme;
           uri->GetScheme(scheme);
           // We don't cache data: scripts!
           if (!scheme.EqualsLiteral("data")) {
--- a/content/events/src/nsEventListenerManager.cpp
+++ b/content/events/src/nsEventListenerManager.cpp
@@ -835,17 +835,17 @@ nsEventListenerManager::CompileEventHand
                                      &argCount, &argNames);
 
     JSAutoRequest ar(cx);
     JSAutoCompartment ac(cx, context->GetNativeGlobal());
     JS::CompileOptions options(cx);
     options.setFileAndLine(url.get(), lineNo)
            .setVersion(SCRIPTVERSION_DEFAULT);
 
-    js::RootedObject rootedNull(cx, nullptr); // See bug 781070.
+    JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
     JSObject *handlerFun = nullptr;
     result = nsJSUtils::CompileFunction(cx, rootedNull, options,
                                         nsAtomCString(aListenerStruct->mTypeAtom),
                                         argCount, argNames, *body, &handlerFun);
     NS_ENSURE_SUCCESS(result, result);
     handler.set(handlerFun);
     NS_ENSURE_TRUE(handler, NS_ERROR_FAILURE);
   }
--- a/content/xbl/src/nsXBLBinding.cpp
+++ b/content/xbl/src/nsXBLBinding.cpp
@@ -1432,17 +1432,17 @@ nsXBLBinding::LookupMember(JSContext* aC
   JSObject* boundScope =
     js::GetGlobalForObjectCrossCompartment(mBoundElement->GetWrapper());
   JSObject* xblScope = xpc::GetXBLScope(aCx, boundScope);
   MOZ_ASSERT(boundScope != xblScope);
 
   // Enter the xbl scope and invoke the internal version.
   {
     JSAutoCompartment ac(aCx, xblScope);
-    js::RootedId id(aCx, aId);
+    JS::RootedId id(aCx, aId);
     if (!JS_WrapId(aCx, id.address()) ||
         !LookupMemberInternal(aCx, name, id, aDesc, xblScope))
     {
       return false;
     }
   }
 
   // Wrap into the caller's scope.
@@ -1462,17 +1462,17 @@ nsXBLBinding::LookupMemberInternal(JSCon
       return true;
     }
     return mNextBinding->LookupMemberInternal(aCx, aName, aNameAsId,
                                               aDesc, aXBLScope);
   }
 
   // Find our class object. It's in a protected scope and permanent just in case,
   // so should be there no matter what.
-  js::RootedValue classObject(aCx);
+  JS::RootedValue classObject(aCx);
   if (!JS_GetProperty(aCx, aXBLScope, mJSClass->name, classObject.address())) {
     return false;
   }
   MOZ_ASSERT(classObject.isObject());
 
   // Look for the property on this binding. If it's not there, try the next
   // binding on the chain.
   nsXBLProtoImpl* impl = mPrototypeBinding->GetImplementation();
--- a/content/xbl/src/nsXBLProtoImplField.cpp
+++ b/content/xbl/src/nsXBLProtoImplField.cpp
@@ -165,17 +165,17 @@ InstallXBLField(JSContext* cx,
   // because in this method we've entered |this|'s compartment (see in
   // Field[GS]etter where we attempt a cross-compartment call), we must enter
   // the callee's compartment to access its reserved slots.
   nsXBLPrototypeBinding* protoBinding;
   nsDependentJSString fieldName;
   {
     JSAutoCompartment ac(cx, callee);
 
-    js::Rooted<JSObject*> xblProto(cx);
+    JS::Rooted<JSObject*> xblProto(cx);
     xblProto = &js::GetFunctionNativeReserved(callee, XBLPROTO_SLOT).toObject();
 
     JS::Value name = js::GetFunctionNativeReserved(callee, FIELD_SLOT);
     JSFlatString* fieldStr = JS_ASSERT_STRING_IS_FLAT(name.toString());
     fieldName.init(fieldStr);
 
     MOZ_ALWAYS_TRUE(JS_ValueToId(cx, name, idp));
 
@@ -215,36 +215,36 @@ InstallXBLField(JSContext* cx,
 }
 
 bool
 FieldGetterImpl(JSContext *cx, JS::CallArgs args)
 {
   const JS::Value &thisv = args.thisv();
   MOZ_ASSERT(ValueHasISupportsPrivate(thisv));
 
-  js::Rooted<JSObject*> thisObj(cx, &thisv.toObject());
+  JS::Rooted<JSObject*> thisObj(cx, &thisv.toObject());
 
   // We should be in the compartment of |this|. If we got here via nativeCall,
   // |this| is not same-compartment with |callee|, and it's possible via
   // asymmetric security semantics that |args.calleev()| is actually a security
   // wrapper. In this case, we know we want to do an unsafe unwrap, and
   // InstallXBLField knows how to handle cross-compartment pointers.
   bool installed = false;
-  js::Rooted<JSObject*> callee(cx, js::UnwrapObject(&args.calleev().toObject()));
-  js::Rooted<jsid> id(cx);
+  JS::Rooted<JSObject*> callee(cx, js::UnwrapObject(&args.calleev().toObject()));
+  JS::Rooted<jsid> id(cx);
   if (!InstallXBLField(cx, callee, thisObj, id.address(), &installed)) {
     return false;
   }
 
   if (!installed) {
     args.rval().setUndefined();
     return true;
   }
 
-  js::Rooted<JS::Value> v(cx);
+  JS::Rooted<JS::Value> v(cx);
   if (!JS_GetPropertyById(cx, thisObj, id, v.address())) {
     return false;
   }
   args.rval().set(v);
   return true;
 }
 
 static JSBool
@@ -256,32 +256,32 @@ FieldGetter(JSContext *cx, unsigned argc
 }
 
 bool
 FieldSetterImpl(JSContext *cx, JS::CallArgs args)
 {
   const JS::Value &thisv = args.thisv();
   MOZ_ASSERT(ValueHasISupportsPrivate(thisv));
 
-  js::Rooted<JSObject*> thisObj(cx, &thisv.toObject());
+  JS::Rooted<JSObject*> thisObj(cx, &thisv.toObject());
 
   // We should be in the compartment of |this|. If we got here via nativeCall,
   // |this| is not same-compartment with |callee|, and it's possible via
   // asymmetric security semantics that |args.calleev()| is actually a security
   // wrapper. In this case, we know we want to do an unsafe unwrap, and
   // InstallXBLField knows how to handle cross-compartment pointers.
   bool installed = false;
-  js::Rooted<JSObject*> callee(cx, js::UnwrapObject(&args.calleev().toObject()));
-  js::Rooted<jsid> id(cx);
+  JS::Rooted<JSObject*> callee(cx, js::UnwrapObject(&args.calleev().toObject()));
+  JS::Rooted<jsid> id(cx);
   if (!InstallXBLField(cx, callee, thisObj, id.address(), &installed)) {
     return false;
   }
 
   if (installed) {
-    js::Rooted<JS::Value> v(cx,
+    JS::Rooted<JS::Value> v(cx,
                             args.length() > 0 ? args[0] : JS::UndefinedValue());
     if (!::JS_SetPropertyById(cx, thisObj, id, v.address())) {
       return false;
     }
   }
   args.rval().setUndefined();
   return true;
 }
--- a/content/xbl/src/nsXBLProtoImplMethod.cpp
+++ b/content/xbl/src/nsXBLProtoImplMethod.cpp
@@ -197,17 +197,17 @@ nsXBLProtoImplMethod::CompileMember(nsIS
   AutoPushJSContext cx(aContext->GetNativeContext());
   JSAutoRequest ar(cx);
   JSAutoCompartment ac(cx, aClassObject);
   JS::CompileOptions options(cx);
   options.setFileAndLine(functionUri.get(),
                          uncompiledMethod->mBodyText.GetLineNumber())
          .setVersion(JSVERSION_LATEST)
          .setUserBit(true); // Flag us as XBL
-  js::RootedObject rootedNull(cx, nullptr); // See bug 781070.
+  JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
   nsresult rv = nsJSUtils::CompileFunction(cx, rootedNull, options, cname,
                                            paramCount,
                                            const_cast<const char**>(args),
                                            body, &methodObject);
 
   // Destroy our uncompiled method and delete our arg list.
   delete uncompiledMethod;
   delete [] args;
--- a/content/xbl/src/nsXBLProtoImplProperty.cpp
+++ b/content/xbl/src/nsXBLProtoImplProperty.cpp
@@ -213,17 +213,17 @@ nsXBLProtoImplProperty::CompileMember(ns
       AutoPushJSContext cx(aContext->GetNativeContext());
       JSAutoRequest ar(cx);
       JSAutoCompartment ac(cx, aClassObject);
       JS::CompileOptions options(cx);
       options.setFileAndLine(functionUri.get(), mGetterText->GetLineNumber())
              .setVersion(JSVERSION_LATEST)
              .setUserBit(true); // Flag us as XBL
       nsCString name = NS_LITERAL_CSTRING("get_") + NS_ConvertUTF16toUTF8(mName);
-      js::RootedObject rootedNull(cx, nullptr); // See bug 781070.
+      JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
       rv = nsJSUtils::CompileFunction(cx, rootedNull, options, name, 0, nullptr,
                                       getter, &getterObject);
 
       // Make sure we free mGetterText here before setting mJSGetterObject, since
       // that'll overwrite mGetterText
       delete mGetterText;
       deletedGetter = true;
       mJSGetterObject = getterObject;
@@ -263,17 +263,17 @@ nsXBLProtoImplProperty::CompileMember(ns
       AutoPushJSContext cx(aContext->GetNativeContext());
       JSAutoRequest ar(cx);
       JSAutoCompartment ac(cx, aClassObject);
       JS::CompileOptions options(cx);
       options.setFileAndLine(functionUri.get(), mSetterText->GetLineNumber())
              .setVersion(JSVERSION_LATEST)
              .setUserBit(true); // Flag us as XBL
       nsCString name = NS_LITERAL_CSTRING("set_") + NS_ConvertUTF16toUTF8(mName);
-      js::RootedObject rootedNull(cx, nullptr); // See bug 781070.
+      JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
       rv = nsJSUtils::CompileFunction(cx, rootedNull, options, name, 1,
                                       gPropertyArgs, setter, &setterObject);
 
       // Make sure we free mSetterText here before setting mJSGetterObject, since
       // that'll overwrite mSetterText
       delete mSetterText;
       deletedSetter = true;
       mJSSetterObject = setterObject;
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -385,17 +385,17 @@ nsXBLPrototypeHandler::EnsureEventHandle
   // Compile the event handler in the xbl scope.
   JSAutoRequest ar(cx);
   JSAutoCompartment ac(cx, scopeObject);
   JS::CompileOptions options(cx);
   options.setFileAndLine(bindingURI.get(), mLineNumber)
          .setVersion(JSVERSION_LATEST)
          .setUserBit(true); // Flag us as XBL
 
-  js::RootedObject rootedNull(cx, nullptr); // See bug 781070.
+  JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
   JSObject* handlerFun = nullptr;
   nsresult rv = nsJSUtils::CompileFunction(cx, rootedNull, options,
                                            nsAtomCString(aName), argCount,
                                            argNames, handlerText, &handlerFun);
   NS_ENSURE_SUCCESS(rv, rv);
   NS_ENSURE_TRUE(handlerFun, NS_ERROR_FAILURE);
 
   // Wrap the handler into the content scope, since we're about to stash it
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -5347,33 +5347,33 @@ LocationSetter(JSContext *cx, JSHandleOb
 
   return JS_TRUE;
 }
 
 static JSBool
 LocationSetterUnwrapper(JSContext *cx, JSHandleObject obj_, JSHandleId id, JSBool strict,
                         JSMutableHandleValue vp)
 {
-  js::RootedObject obj(cx, obj_);
+  JS::RootedObject obj(cx, obj_);
 
   JSObject *wrapped = XPCWrapper::UnsafeUnwrapSecurityWrapper(obj);
   if (wrapped) {
     obj = wrapped;
   }
 
   return LocationSetter<nsIDOMWindow>(cx, obj, id, strict, vp);
 }
 
 NS_IMETHODIMP
 nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
                        JSObject *obj_, jsid id_, uint32_t flags,
                        JSObject **objp, bool *_retval)
 {
-  js::RootedObject obj(cx, obj_);
-  js::RootedId id(cx, id_);
+  JS::RootedObject obj(cx, obj_);
+  JS::RootedId id(cx, id_);
 
   if (!JSID_IS_STRING(id)) {
     return NS_OK;
   }
 
   nsGlobalWindow *win = nsGlobalWindow::FromWrapper(wrapper);
   MOZ_ASSERT(win->IsInnerWindow());
 
@@ -5557,17 +5557,17 @@ nsWindowSH::NewResolve(nsIXPConnectWrapp
         *objp = obj;
 
         return NS_OK;
       }
     }
   }
 
   // Handle resolving if id refers to a name resolved by DOM worker code.
-  js::RootedObject tmp(cx, NULL);
+  JS::RootedObject tmp(cx, NULL);
   if (!ResolveWorkerClasses(cx, obj, id, flags, &tmp)) {
     return NS_ERROR_FAILURE;
   }
   if (tmp) {
     *objp = tmp;
     return NS_OK;
   }
 
@@ -5748,17 +5748,17 @@ nsWindowSH::NewResolve(nsIXPConnectWrapp
       // property.
       //
       // We're adding a new property here, so we don't need to worry about
       // conflicting with any existing ones.
       //
       // Since we always create the undeclared property here, shortcutting the
       // normal process, we go out of our way to tell the JS engine to report
       // strict warnings/errors using js::ReportIfUndeclaredVarAssignment.
-      js::Rooted<JSString*> str(cx, JSID_TO_STRING(id));
+      JS::Rooted<JSString*> str(cx, JSID_TO_STRING(id));
       if (!js::ReportIfUndeclaredVarAssignment(cx, str) ||
           !::JS_DefinePropertyById(cx, obj, id, JSVAL_VOID, JS_PropertyStub,
                                    JS_StrictPropertyStub, JSPROP_ENUMERATE)) {
         *_retval = JS_FALSE;
 
         return NS_OK;
       }
 
@@ -7029,17 +7029,17 @@ nsHTMLDocumentSH::DocumentAllGetProperty
 
   return JS_TRUE;
 }
 
 JSBool
 nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id,
                                         unsigned flags, JSMutableHandleObject objp)
 {
-  js::RootedValue v(cx);
+  JS::RootedValue v(cx);
 
   if (sItem_id == id || sNamedItem_id == id) {
     // Define the item() or namedItem() method.
 
     JSFunction *fnc = ::JS_DefineFunctionById(cx, obj, id, CallToGetPropMapper,
                                               0, JSPROP_ENUMERATE);
     objp.set(obj);
 
@@ -7166,17 +7166,17 @@ nsHTMLDocumentSH::DocumentAllHelperGetPr
     // document as its private nsISupports data.
     nsresult rv;
     nsCOMPtr<nsIHTMLDocument> doc = do_QueryWrapper(cx, obj, &rv);
     if (NS_FAILED(rv)) {
       xpc::Throw(cx, rv);
       return JS_FALSE;
     }
 
-    js::Rooted<JSObject*> all(cx);
+    JS::Rooted<JSObject*> all(cx);
     all = ::JS_NewObject(cx, &sHTMLDocumentAllClass, nullptr,
                          ::JS_GetGlobalForObject(cx, obj));
     if (!all) {
       return JS_FALSE;
     }
 
     // Let the JSObject take over ownership of doc.
     ::JS_SetPrivate(all, doc.forget().get());
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2095,17 +2095,17 @@ nsDOMWindowUtils::GetParent(const JS::Va
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   // First argument must be an object.
   if (JSVAL_IS_PRIMITIVE(aObject)) {
     return NS_ERROR_XPC_BAD_CONVERT_JS;
   }
 
-  js::Rooted<JSObject*> parent(aCx, JS_GetParent(JSVAL_TO_OBJECT(aObject)));
+  JS::Rooted<JSObject*> parent(aCx, JS_GetParent(JSVAL_TO_OBJECT(aObject)));
   *aParent = OBJECT_TO_JSVAL(parent);
 
   // Outerize if necessary.
   if (parent) {
     if (JSObjectOp outerize = js::GetObjectClass(parent)->ext.outerObject) {
       *aParent = OBJECT_TO_JSVAL(outerize(aCx, parent));
     }
   }
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -1278,17 +1278,17 @@ nsJSContext::EvaluateString(const nsAStr
   // Scope the JSAutoCompartment so that it gets destroyed before we pop the
   // cx and potentially call JS_RestoreFrameChain.
   XPCAutoRequest ar(mContext);
   {
     JSAutoCompartment ac(mContext, &aScopeObject);
 
     ++mExecuteDepth;
 
-    js::RootedObject rootedScope(mContext, &aScopeObject);
+    JS::RootedObject rootedScope(mContext, &aScopeObject);
     ok = JS::Evaluate(mContext, rootedScope, aOptions,
                       PromiseFlatString(aScript).get(),
                       aScript.Length(), aRetValue);
     if (ok && aCoerceToString && !aRetValue->isUndefined()) {
       JSString* str = JS_ValueToString(mContext, *aRetValue);
       ok = !!str;
       *aRetValue = ok ? JS::StringValue(str) : JS::UndefinedValue();
     }
@@ -1361,17 +1361,17 @@ nsJSContext::CompileScript(const PRUnich
   JS::CompileOptions options(mContext);
   JS::CompileOptions::SourcePolicy sp = aSaveSource ?
     JS::CompileOptions::SAVE_SOURCE :
     JS::CompileOptions::LAZY_SOURCE;
   options.setPrincipals(nsJSPrincipals::get(aPrincipal))
          .setFileAndLine(aURL, aLineNo)
          .setVersion(JSVersion(aVersion))
          .setSourcePolicy(sp);
-  js::RootedObject rootedScope(mContext, scopeObject);
+  JS::RootedObject rootedScope(mContext, scopeObject);
   JSScript* script = JS::Compile(mContext,
                                  rootedScope,
                                  options,
                                  static_cast<const jschar*>(aText),
                                  aTextLength);
   if (!script) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
--- a/dom/base/nsScreen.cpp
+++ b/dom/base/nsScreen.cpp
@@ -278,17 +278,17 @@ nsScreen::MozLockOrientation(const JS::V
     }
 
     for (uint32_t i = 0; i < length; ++i) {
       JS::Value temp;
       if (!JS_GetElement(aCx, seq, i, &temp)) {
         return NS_ERROR_FAILURE;
       }
 
-      js::RootedString jsString(aCx, JS_ValueToString(aCx, temp));
+      JS::RootedString jsString(aCx, JS_ValueToString(aCx, temp));
       if (!jsString) {
         return NS_ERROR_FAILURE;
       }
 
       nsDependentJSString str;
       if (!str.init(aCx, jsString)) {
         return NS_ERROR_FAILURE;
       }
@@ -296,17 +296,17 @@ nsScreen::MozLockOrientation(const JS::V
       *orientations.AppendElement() = str;
     }
 
     ErrorResult rv;
     *aReturn = MozLockOrientation(orientations, rv);
     return rv.ErrorCode();
   }
 
-  js::RootedString jsString(aCx, JS_ValueToString(aCx, aOrientation));
+  JS::RootedString jsString(aCx, JS_ValueToString(aCx, aOrientation));
   if (!jsString) {
     return NS_ERROR_FAILURE;
   }
 
   nsDependentJSString orientation;
   if (!orientation.init(aCx, jsString)) {
     return NS_ERROR_FAILURE;
   }
--- a/dom/bindings/BindingDeclarations.h
+++ b/dom/bindings/BindingDeclarations.h
@@ -49,17 +49,17 @@ public:
   }
 
   bool Failed() const
   {
     return !Get();
   }
 
 private:
-  js::RootedObject mGlobalJSObject;
+  JS::RootedObject mGlobalJSObject;
   nsISupports* mGlobalObject;
   nsCOMPtr<nsISupports> mGlobalObjectRef;
 };
 
 class NS_STACK_CLASS WorkerGlobalObject
 {
 public:
   WorkerGlobalObject(JSContext* aCx, JSObject* aObject);
@@ -77,17 +77,17 @@ public:
   }
 
   bool Failed() const
   {
     return !Get();
   }
 
 private:
-  js::RootedObject mGlobalJSObject;
+  JS::RootedObject mGlobalJSObject;
   JSContext* mCx;
 };
 
 /**
  * A class for representing string return values.  This can be either passed to
  * callees that have an nsString or nsAString out param or passed to a callee
  * that actually knows about this class and can work with it.  Such a callee may
  * call SetStringBuffer on this object, but only if it plans to keep holding a
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -1407,26 +1407,26 @@ protected:
   }
 
   nsRefPtr<T> ptr;
 #ifdef DEBUG
   bool inited;
 #endif
 };
 
-class NonNullLazyRootedObject : public Maybe<js::RootedObject>
+class NonNullLazyRootedObject : public Maybe<JS::RootedObject>
 {
 public:
   operator JSObject&() const {
     MOZ_ASSERT(!empty() && ref(), "Can not alias null.");
     return *ref();
   }
 };
 
-class LazyRootedObject : public Maybe<js::RootedObject>
+class LazyRootedObject : public Maybe<JS::RootedObject>
 {
 public:
   operator JSObject*() const {
     return empty() ? (JSObject*) nullptr : ref();
   }
 };
 
 // A struct that has the same layout as an nsDependentString but much
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -4338,17 +4338,17 @@ class CGAbstractBindingMethod(CGAbstract
             self.unwrapFailureCode = unwrapFailureCode
         self.getThisObj = getThisObj
 
     def definition_body(self):
         # Our descriptor might claim that we're not castable, simply because
         # we're someone's consequential interface.  But for this-unwrapping, we
         # know that we're the real deal.  So fake a descriptor here for
         # consumption by CastableObjectUnwrapper.
-        getThis = CGGeneric("""js::RootedObject obj(cx, %s);
+        getThis = CGGeneric("""JS::RootedObject obj(cx, %s);
 if (!obj) {
   return false;
 }
 
 %s* self;""" % (self.getThisObj, self.descriptor.nativeType))
         unwrapThis = CGGeneric(
             str(CastableObjectUnwrapper(
                         self.descriptor,
@@ -4366,17 +4366,17 @@ class CGAbstractStaticBindingMethod(CGAb
     global object.  Subclasses are expected to override the generate_code
     function to do the rest of the work.  This function should return a
     CGThing which is already properly indented.
     """
     def __init__(self, descriptor, name, args):
         CGAbstractStaticMethod.__init__(self, descriptor, name, "JSBool", args)
 
     def definition_body(self):
-        unwrap = CGGeneric("""js::RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
+        unwrap = CGGeneric("""JS::RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
 if (!obj) {
   return false;
 }
 """)
         return CGList([ CGIndenter(unwrap),
                         self.generate_code() ], "\n\n").define()
 
     def generate_code(self):
@@ -4674,17 +4674,17 @@ class CGSpecializedForwardingSetter(CGSp
         CGSpecializedSetter.__init__(self, descriptor, attr)
 
     def definition_body(self):
         attrName = self.attr.identifier.name
         forwardToAttrName = self.attr.getExtendedAttribute("PutForwards")[0]
         # JS_GetProperty and JS_SetProperty can only deal with ASCII
         assert all(ord(c) < 128 for c in attrName)
         assert all(ord(c) < 128 for c in forwardToAttrName)
-        return CGIndenter(CGGeneric("""js::RootedValue v(cx);
+        return CGIndenter(CGGeneric("""JS::RootedValue v(cx);
 if (!JS_GetProperty(cx, obj, "%s", v.address())) {
   return false;
 }
 
 if (!v.isObject()) {
   return ThrowErrorMessage(cx, MSG_NOT_OBJECT);
 }
 
--- a/dom/indexedDB/KeyPath.cpp
+++ b/dom/indexedDB/KeyPath.cpp
@@ -343,17 +343,17 @@ KeyPath::ExtractKeyAsJSVal(JSContext* aC
   NS_ASSERTION(IsValid(), "This doesn't make sense!");
 
   if (IsString()) {
     return GetJSValFromKeyPathString(aCx, aValue, mStrings[0], aOutVal,
                                      DoNotCreateProperties, nullptr, nullptr);
   }
  
   const uint32_t len = mStrings.Length();
-  js::RootedObject arrayObj(aCx, JS_NewArrayObject(aCx, len, nullptr));
+  JS::RootedObject arrayObj(aCx, JS_NewArrayObject(aCx, len, nullptr));
   if (!arrayObj) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   JS::Value value;
   for (uint32_t i = 0; i < len; ++i) {
     nsresult rv = GetJSValFromKeyPathString(aCx, aValue, mStrings[i], &value,
                                             DoNotCreateProperties, nullptr,
--- a/dom/src/json/nsJSON.cpp
+++ b/dom/src/json/nsJSON.cpp
@@ -496,17 +496,17 @@ nsJSON::LegacyDecodeFromStream(nsIInputS
   return DecodeInternal(cx, aStream, aContentLength, true, aRetval, LEGACY);
 }
 
 NS_IMETHODIMP
 nsJSON::LegacyDecodeToJSVal(const nsAString &str, JSContext *cx, jsval *result)
 {
   JSAutoRequest ar(cx);
 
-  js::RootedValue reviver(cx, JS::NullValue()), value(cx);
+  JS::RootedValue reviver(cx, JS::NullValue()), value(cx);
 
   JS::StableCharPtr chars(static_cast<const jschar*>(PromiseFlatString(str).get()),
                           str.Length());
   if (!js::ParseJSONWithReviver(cx, chars, str.Length(), reviver,
                                 &value, LEGACY)) {
     return NS_ERROR_UNEXPECTED;
   }
 
@@ -567,17 +567,17 @@ nsJSONListener::OnStopRequest(nsIRequest
 
   // This can happen with short UTF-8 messages (<4 bytes)
   if (!mSniffBuffer.IsEmpty()) {
     // Just consume mSniffBuffer
     rv = ProcessBytes(nullptr, 0);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  js::RootedValue reviver(mCx, JS::NullValue()), value(mCx);
+  JS::RootedValue reviver(mCx, JS::NullValue()), value(mCx);
 
   JS::StableCharPtr chars(reinterpret_cast<const jschar*>(mBufferedChars.Elements()),
                           mBufferedChars.Length());
   JSBool ok = js::ParseJSONWithReviver(mCx, chars,
                                        (uint32_t) mBufferedChars.Length(),
                                        reviver, &value,
                                        mDecodingMode);
 
--- a/dom/workers/ScriptLoader.cpp
+++ b/dom/workers/ScriptLoader.cpp
@@ -580,17 +580,17 @@ ScriptExecutorRunnable::WorkerRun(JSCont
     NS_ASSERTION(!loadInfo.mChannel, "Should no longer have a channel!");
     NS_ASSERTION(loadInfo.mExecutionScheduled, "Should be scheduled!");
 
     if (!loadInfo.mExecutionResult) {
       return true;
     }
   }
 
-  js::RootedObject global(aCx, JS_GetGlobalObject(aCx));
+  JS::RootedObject global(aCx, JS_GetGlobalObject(aCx));
   NS_ASSERTION(global, "Must have a global by now!");
 
   JSPrincipals* principal = GetWorkerPrincipal();
   NS_ASSERTION(principal, "This should never be null!");
 
   for (uint32_t index = mFirstIndex; index <= mLastIndex; index++) {
     ScriptLoadInfo& loadInfo = loadInfos.ElementAt(index);
 
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3874,17 +3874,17 @@ WorkerPrivate::RunExpiredTimeouts(JSCont
   }
 
   NS_ASSERTION(mTimer, "Must have a timer!");
   NS_ASSERTION(!mTimeouts.IsEmpty(), "Should have some work to do!");
 
   bool retval = true;
 
   AutoPtrComparator<TimeoutInfo> comparator = GetAutoPtrComparator(mTimeouts);
-  js::RootedObject global(aCx, JS_GetGlobalObject(aCx));
+  JS::RootedObject global(aCx, JS_GetGlobalObject(aCx));
   JSPrincipals* principal = GetWorkerPrincipal();
 
   // We want to make sure to run *something*, even if the timer fired a little
   // early. Fudge the value of now to at least include the first timeout.
   const TimeStamp now = std::max(TimeStamp::Now(), mTimeouts[0]->mTargetTime);
 
   nsAutoTArray<TimeoutInfo*, 10> expiredTimeouts;
   for (uint32_t index = 0; index < mTimeouts.Length(); index++) {
--- a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
+++ b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
@@ -196,17 +196,17 @@ nsresult EvaluateAdminConfigScript(const
     }
 
     JS_BeginRequest(autoconfig_cx);
     nsCOMPtr<nsIPrincipal> principal;
     nsContentUtils::GetSecurityManager()->GetSystemPrincipal(getter_AddRefs(principal));
     JS::CompileOptions options(autoconfig_cx);
     options.setPrincipals(nsJSPrincipals::get(principal))
            .setFileAndLine(filename, 1);
-    js::RootedObject glob(autoconfig_cx, autoconfig_glob);
+    JS::RootedObject glob(autoconfig_cx, autoconfig_glob);
     ok = JS::Evaluate(autoconfig_cx, glob, options, js_buffer, length, nullptr);
     JS_EndRequest(autoconfig_cx);
 
     JS_MaybeGC(autoconfig_cx);
 
     JSContext *cx;
     cxstack->Pop(&cx);
     NS_ASSERTION(cx == autoconfig_cx, "AutoConfig JS contexts didn't match");
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -295,17 +295,17 @@ Load(JSContext *cx,
         if (!file) {
             JS_ReportError(cx, "cannot open file '%s' for reading", filename.ptr());
             return JS_FALSE;
         }
         JS::CompileOptions options(cx);
         options.setUTF8(true)
                .setFileAndLine(filename.ptr(), 1)
                .setPrincipals(Environment(cx)->GetPrincipal());
-        js::RootedObject rootedObj(cx, obj);
+        JS::RootedObject rootedObj(cx, obj);
         JSScript *script = JS::Compile(cx, rootedObj, options, file);
         fclose(file);
         if (!script)
             return JS_FALSE;
 
         if (!Environment(cx)->ShouldCompileOnly() &&
             !JS_ExecuteScript(cx, obj, script, &result)) {
             return JS_FALSE;
@@ -563,17 +563,17 @@ ProcessFile(JSContext *cx,
 
         JSAutoRequest ar(cx);
         JSAutoCompartment ac(cx, obj);
 
         JS::CompileOptions options(cx);
         options.setUTF8(true)
                .setFileAndLine(filename, 1)
                .setPrincipals(env->GetPrincipal());
-        js::RootedObject rootedObj(cx, obj);
+        JS::RootedObject rootedObj(cx, obj);
         JSScript* script = JS::Compile(cx, rootedObj, options, file);
         if (script && !env->ShouldCompileOnly())
             (void)JS_ExecuteScript(cx, obj, script, &result);
 
         return;
     }
 
     /* It's an interactive filehandle; drop into read-eval-print loop. */
--- a/js/ipc/ObjectWrapperParent.cpp
+++ b/js/ipc/ObjectWrapperParent.cpp
@@ -304,17 +304,17 @@ JSObject_from_PObjectWrapperParent(JSCon
 }
 
 /*static*/ bool
 ObjectWrapperParent::
 jsval_from_PObjectWrapperParent(JSContext* cx,
                                 const PObjectWrapperParent* from,
                                 jsval* to)
 {
-    js::RootedObject obj(cx);
+    JS::RootedObject obj(cx);
     if (!JSObject_from_PObjectWrapperParent(cx, from, &obj))
         return false;
     *to = OBJECT_TO_JSVAL(obj);
     return true;
 }
     
 static bool
 jsid_from_int(JSContext* cx, int from, jsid* to)
@@ -561,17 +561,17 @@ ObjectWrapperParent::CPOW_NewResolve(JSC
         !self->CallNewResolve(in_id, flags,
                               aco.StatusPtr(), &out_pobj) ||
         !aco.Ok() ||
         !JSObject_from_PObjectWrapperParent(cx, out_pobj, objp))
         return JS_FALSE;
 
     if (objp) {
         AutoResolveFlag arf(objp);
-        js::RootedObject obj2(cx, objp);
+        JS::RootedObject obj2(cx, objp);
         JS_DefinePropertyById(cx, obj2, id, JSVAL_VOID, NULL, NULL,
                               JSPROP_ENUMERATE);
     }
     return JS_TRUE;
 }
 
 /*static*/ JSBool
 ObjectWrapperParent::CPOW_Convert(JSContext *cx, JSHandleObject obj, JSType type,
--- a/js/jsd/jsd_stak.cpp
+++ b/js/jsd/jsd_stak.cpp
@@ -89,17 +89,17 @@ jsd_NewThreadState(JSDContext* jsdc, JSC
     JS_BeginRequest(jsdthreadstate->context);
 
     JSBrokenFrameIterator iter(cx);
     while(!iter.done())
     {
         JSAbstractFramePtr frame = iter.abstractFramePtr();
         JSScript* script = frame.script();
         uintptr_t  pc = (uintptr_t)iter.pc();
-        js::RootedValue dummyThis(cx);
+        JS::RootedValue dummyThis(cx);
 
         /*
          * don't construct a JSDStackFrame for dummy frames (those without a
          * |this| object, or native frames, if JSD_INCLUDE_NATIVE_FRAMES
          * isn't set.
          */
         if (frame.getThisValue(cx, &dummyThis))
         {
@@ -306,17 +306,17 @@ jsd_GetThisForStackFrame(JSDContext* jsd
                          JSDStackFrameInfo* jsdframe)
 {
     JSDValue* jsdval = NULL;
     JSD_LOCK_THREADSTATES(jsdc);
 
     if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
     {
         JSBool ok;
-        js::RootedValue thisval(jsdthreadstate->context);
+        JS::RootedValue thisval(jsdthreadstate->context);
         JS_BeginRequest(jsdthreadstate->context);
         ok = jsdframe->frame.getThisValue(jsdthreadstate->context, &thisval);
         JS_EndRequest(jsdthreadstate->context);
         if(ok)
             jsdval = JSD_NewValue(jsdc, thisval);
     }
 
     JSD_UNLOCK_THREADSTATES(jsdc);
--- a/js/jsd/jsd_step.cpp
+++ b/js/jsd/jsd_step.cpp
@@ -90,17 +90,17 @@ JSBool
     {
         /* no hook to call, no profile data needs to be collected,
          * so there is nothing to do here.
          */
         return hookresult;
     }
 
     if (before && isConstructing) {
-        js::RootedValue newObj(cx);
+        JS::RootedValue newObj(cx);
         if (!frame.getThisValue(cx, &newObj))
             return JS_FALSE;
         jsd_Constructing(jsdc, cx, JSVAL_TO_OBJECT(newObj), frame);
     }
 
     jsscript = frame.script();
     if (jsscript)
     {
--- a/js/jsd/jsd_xpc.cpp
+++ b/js/jsd/jsd_xpc.cpp
@@ -2023,17 +2023,17 @@ jsdStackFrame::Eval (const nsAString &by
     nsAString::const_iterator h;
     bytes.BeginReading(h);
     const jschar *char_bytes = reinterpret_cast<const jschar *>(h.get());
 
     JSExceptionState *estate = 0;
 
     JSContext *cx = JSD_GetJSContext (mCx, mThreadState);
 
-    js::RootedValue jv(cx);
+    JS::RootedValue jv(cx);
     JSAutoRequest ar(cx);
 
     estate = JS_SaveExceptionState (cx);
     JS_ClearPendingException (cx);
 
     nsresult rv;
     nsCOMPtr<nsIJSContextStack> stack = do_GetService("@mozilla.org/js/xpc/ContextStack;1", &rv);
     if (NS_SUCCEEDED(rv))
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -893,17 +893,17 @@ mozJSComponentLoader::ObjectForLocation(
         JS::CompileOptions options(cx);
         options.setPrincipals(nsJSPrincipals::get(mSystemPrincipal))
                .setNoScriptRval(mReuseLoaderGlobal ? false : true)
                .setVersion(JSVERSION_LATEST)
                .setFileAndLine(nativePath.get(), 1)
                .setSourcePolicy(mReuseLoaderGlobal ?
                                 JS::CompileOptions::NO_SOURCE :
                                 JS::CompileOptions::LAZY_SOURCE);
-        js::RootedObject rootedObject(cx, obj);
+        JS::RootedObject rootedObject(cx, obj);
 
         if (realFile) {
 #ifdef HAVE_PR_MEMMAP
             int64_t fileSize;
             rv = aComponentFile->GetFileSize(&fileSize);
             if (NS_FAILED(rv)) {
                 JS_SetOptions(cx, oldopts);
                 return rv;
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -120,17 +120,17 @@ mozJSSubScriptLoader::ReadScript(nsIURI 
 
     /* set our own error reporter so we can report any bad things as catchable
      * exceptions, including the source/line number */
     er = JS_SetErrorReporter(cx, mozJSLoaderErrorReporter);
 
     JS::CompileOptions options(cx);
     options.setPrincipals(nsJSPrincipals::get(principal))
            .setFileAndLine(uriStr, 1);
-    js::RootedObject target_obj_root(cx, target_obj);
+    JS::RootedObject target_obj_root(cx, target_obj);
     if (!charset.IsVoid()) {
         nsString script;
         rv = nsScriptLoader::ConvertToUTF16(nullptr, reinterpret_cast<const uint8_t*>(buf.get()), len,
                                             charset, nullptr, script);
 
         if (NS_FAILED(rv)) {
             return ReportError(cx, LOAD_ERROR_BADCHARSET);
         }
--- a/js/xpconnect/shell/xpcshell.cpp
+++ b/js/xpconnect/shell/xpcshell.cpp
@@ -468,17 +468,17 @@ Load(JSContext *cx, unsigned argc, jsval
             JS_ReportError(cx, "cannot open file '%s' for reading",
                            filename.ptr());
             return false;
         }
         JS::CompileOptions options(cx);
         options.setUTF8(true)
                .setFileAndLine(filename.ptr(), 1)
                .setPrincipals(gJSPrincipals);
-        js::RootedObject rootedObj(cx, obj);
+        JS::RootedObject rootedObj(cx, obj);
         JSScript *script = JS::Compile(cx, rootedObj, options, file);
         fclose(file);
         if (!script)
             return false;
 
         jsval result;
         if (!compileOnly && !JS_ExecuteScript(cx, obj, script, &result))
             return false;
@@ -1036,17 +1036,17 @@ ProcessFile(JSContext *cx, JSObject *obj
         }
         ungetc(ch, file);
         DoBeginRequest(cx);
 
         JS::CompileOptions options(cx);
         options.setUTF8(true)
                .setFileAndLine(filename, 1)
                .setPrincipals(gJSPrincipals);
-        js::RootedObject rootedObj(cx, obj);
+        JS::RootedObject rootedObj(cx, obj);
         script = JS::Compile(cx, rootedObj, options, file);
         if (script && !compileOnly)
             (void)JS_ExecuteScript(cx, obj, script, &result);
         DoEndRequest(cx);
 
         return;
     }
 
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -2695,17 +2695,17 @@ nsXPCComponents_Utils::LookupMethod(cons
                                     JSContext *cx,
                                     JS::Value *retval)
 {
     JSAutoRequest ar(cx);
 
     // first param must be a JSObject
     if (!object.isObject())
         return NS_ERROR_XPC_BAD_CONVERT_JS;
-    js::RootedObject obj(cx, &object.toObject());
+    JS::RootedObject obj(cx, &object.toObject());
 
     // second param must be a string.
     if (!JSVAL_IS_STRING(name))
         return NS_ERROR_XPC_BAD_CONVERT_JS;
     JSString *methodName = name.toString();
     jsid methodId = INTERNED_STRING_TO_JSID(cx, JS_InternJSString(cx, methodName));
 
     // If |obj| is a cross-compartment wrapper, try to puncture it. If this fails,
@@ -3135,18 +3135,18 @@ extern JSBool
 XPC_WN_Helper_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp);
 
 bool
 xpc::SandboxProxyHandler::getPropertyDescriptor(JSContext *cx, JSObject *proxy,
                                                 jsid id_,
                                                 PropertyDescriptor *desc,
                                                 unsigned flags)
 {
-    js::RootedObject obj(cx, wrappedObject(proxy));
-    js::RootedId id(cx, id_);
+    JS::RootedObject obj(cx, wrappedObject(proxy));
+    JS::RootedId id(cx, id_);
 
     MOZ_ASSERT(js::GetObjectCompartment(obj) == js::GetObjectCompartment(proxy));
     if (!JS_GetPropertyDescriptorById(cx, obj, id,
                                       flags, desc))
         return false;
 
     if (!desc->obj)
         return true; // No property, nothing to do
@@ -3909,17 +3909,17 @@ xpc_EvalInSandbox(JSContext *cx, JSObjec
         JSAutoCompartment ac(sandcx, sandbox);
 
         if (jsVersion != JSVERSION_DEFAULT)
             JS_SetVersion(sandcx, jsVersion);
 
         JS::CompileOptions options(sandcx);
         options.setPrincipals(nsJSPrincipals::get(prin))
                .setFileAndLine(filename, lineNo);
-        js::RootedObject rootedSandbox(sandcx, sandbox);
+        JS::RootedObject rootedSandbox(sandcx, sandbox);
         ok = JS::Evaluate(sandcx, rootedSandbox, options,
                           PromiseFlatString(source).get(), source.Length(), &v);
         if (ok && returnStringOnly && !(JSVAL_IS_VOID(v))) {
             JSString *str = JS_ValueToString(sandcx, v);
             ok = !!str;
             v = ok ? JS::StringValue(str) : JS::UndefinedValue();
         }
 
@@ -4122,17 +4122,17 @@ nsXPCComponents_Utils::GetGlobalForObjec
   if (JSVAL_IS_PRIMITIVE(object))
     return NS_ERROR_XPC_BAD_CONVERT_JS;
 
   // Wrappers are parented to their the global in their home compartment. But
   // when getting the global for a cross-compartment wrapper, we really want
   // a wrapper for the foreign global. So we need to unwrap before getting the
   // parent, enter the compartment for the duration of the call, and wrap the
   // result.
-  js::Rooted<JSObject*> obj(cx, JSVAL_TO_OBJECT(object));
+  JS::Rooted<JSObject*> obj(cx, JSVAL_TO_OBJECT(object));
   obj = js::UnwrapObject(obj);
   {
     JSAutoCompartment ac(cx, obj);
     obj = JS_GetGlobalForObject(cx, obj);
   }
   JS_WrapObject(cx, obj.address());
   *retval = OBJECT_TO_JSVAL(obj);
 
--- a/js/xpconnect/src/XPCDebug.cpp
+++ b/js/xpconnect/src/XPCDebug.cpp
@@ -97,17 +97,17 @@ xpc_DumpEvalInJSStackFrame(JSContext* cx
         return false;
     }
 
     JSAutoRequest ar(cx);
 
     JSExceptionState* exceptionState = JS_SaveExceptionState(cx);
     JSErrorReporter older = JS_SetErrorReporter(cx, xpcDumpEvalErrorReporter);
 
-    js::RootedValue rval(cx);
+    JS::RootedValue rval(cx);
     JSString* str;
     JSAutoByteString bytes;
     if (frame.evaluateInStackFrame(cx, text, strlen(text), "eval", 1, &rval) &&
         nullptr != (str = JS_ValueToString(cx, rval)) &&
         bytes.encodeLatin1(cx, str)) {
         DebugDump("%s\n", bytes.ptr());
     } else
         DebugDump("%s", "eval failed!\n");
--- a/js/xpconnect/src/XPCQuickStubs.h
+++ b/js/xpconnect/src/XPCQuickStubs.h
@@ -643,29 +643,29 @@ PropertyOpForwarder(JSContext *cx, unsig
     // Layout:
     //   this = our this
     //   property op to call = callee reserved slot 0
     //   name of the property = callee reserved slot 1
 
     JS::CallArgs args = CallArgsFromVp(argc, vp);
 
     JSObject *callee = &args.callee();
-    js::RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
+    JS::RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
     if (!obj)
         return false;
 
     jsval v = js::GetFunctionNativeReserved(callee, 0);
 
     JSObject *ptrobj = JSVAL_TO_OBJECT(v);
     Op *popp = static_cast<Op *>(JS_GetPrivate(ptrobj));
 
     v = js::GetFunctionNativeReserved(callee, 1);
 
     jsval argval = (argc > 0) ? args[0] : JSVAL_VOID;
-    js::RootedId id(cx);
+    JS::RootedId id(cx);
     if (!JS_ValueToId(cx, v, id.address()))
         return false;
     args.rval().set(argval);
     return ApplyPropertyOp<Op>(cx, *popp, obj, id, args.rval());
 }
 
 extern JSClass PointerHolderClass;
 
--- a/js/xpconnect/src/XPCRuntimeService.cpp
+++ b/js/xpconnect/src/XPCRuntimeService.cpp
@@ -34,33 +34,33 @@ NS_IMPL_THREADSAFE_RELEASE(BackstagePass
 
 /* bool newResolve (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in jsval id, in uint32_t flags, out JSObjectPtr objp); */
 NS_IMETHODIMP
 BackstagePass::NewResolve(nsIXPConnectWrappedNative *wrapper,
                           JSContext * cx, JSObject * obj_,
                           jsid id_, uint32_t flags,
                           JSObject * *objp_, bool *_retval)
 {
-    js::RootedObject obj(cx, obj_);
-    js::RootedId id(cx, id_);
+    JS::RootedObject obj(cx, obj_);
+    JS::RootedId id(cx, id_);
 
     JSBool resolved;
 
     *_retval = !!JS_ResolveStandardClass(cx, obj, id, &resolved);
     if (!*_retval) {
         *objp_ = nullptr;
         return NS_OK;
     }
 
     if (resolved) {
         *objp_ = obj;
         return NS_OK;
     }
 
-    js::RootedObject objp(cx, *objp_);
+    JS::RootedObject objp(cx, *objp_);
     *_retval = !!ResolveWorkerClasses(cx, obj, id, flags, &objp);
     *objp_ = objp;
     return NS_OK;
 }
 
 /***************************************************************************/
 /* void getInterfaces (out uint32_t count, [array, size_is (count), retval]
                        out nsIIDPtr array); */
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -1290,17 +1290,17 @@ IsTransparent(JSContext *cx, JSObject *w
 {
     // We dynamically waive Xray vision for XBL bindings accessing fields
     // on bound elements, since there's no way to access such things sanely
     // over Xray.
     nsCOMPtr<nsIContent> content;
     if (EnsureCompartmentPrivate(wrapper)->scope->IsXBLScope() &&
         (content = do_QueryInterfaceNative(cx, wrapper)))
     {
-        js::RootedId id_(cx, id);
+        JS::RootedId id_(cx, id);
         if (nsContentUtils::IsBindingField(cx, content, id_))
             return true;
     }
     return false;
 }
 
 JSObject *
 GetNativePropertiesObject(JSContext *cx, JSObject *wrapper)
@@ -1498,17 +1498,17 @@ XrayWrapper<Base, Traits>::getPropertyDe
     // be protected by read-only/non-configurable properties, and any functions
     // we end up with should _always_ be living in our own scope (the XBL scope).
     // Make sure to assert that.
     nsCOMPtr<nsIContent> content;
     if (!desc->obj &&
         EnsureCompartmentPrivate(wrapper)->scope->IsXBLScope() &&
         (content = do_QueryInterfaceNative(cx, wrapper)))
     {
-        js::RootedId id_(cx, id);
+        JS::RootedId id_(cx, id);
         if (!nsContentUtils::LookupBindingMember(cx, content, id_, desc))
             return false;
         DEBUG_CheckXBLLookup(cx, desc);
     }
 
     // If we still have nothing, we're done.
     if (!desc->obj)
       return true;
--- a/netwerk/base/src/ProxyAutoConfig.cpp
+++ b/netwerk/base/src/ProxyAutoConfig.cpp
@@ -628,22 +628,22 @@ ProxyAutoConfig::GetProxyForURI(const ns
   JSAutoRequest ar(cx);
 
   // the sRunning flag keeps a new PAC file from being installed
   // while the event loop is spinning on a DNS function. Don't early return.
   sRunning = this;
   mRunningHost = aTestHost;
 
   nsresult rv = NS_ERROR_FAILURE;
-  js::RootedString uriString(cx, JS_NewStringCopyZ(cx, aTestURI.get()));
-  js::RootedString hostString(cx, JS_NewStringCopyZ(cx, aTestHost.get()));
+  JS::RootedString uriString(cx, JS_NewStringCopyZ(cx, aTestURI.get()));
+  JS::RootedString hostString(cx, JS_NewStringCopyZ(cx, aTestHost.get()));
 
   if (uriString && hostString) {
-    js::RootedValue uriValue(cx, STRING_TO_JSVAL(uriString));
-    js::RootedValue hostValue(cx, STRING_TO_JSVAL(hostString));
+    JS::RootedValue uriValue(cx, STRING_TO_JSVAL(uriString));
+    JS::RootedValue hostValue(cx, STRING_TO_JSVAL(hostString));
 
     JS::Value argv[2] = { uriValue, hostValue };
     JS::Value rval;
     JSBool ok = JS_CallFunctionName(cx, mJSRuntime->Global(),
                                     "FindProxyForURL", 2, argv, &rval);
 
     if (ok && rval.isString()) {
       nsDependentJSString pacString;