Backed out changeset e112b04664a6 (bug 848395)
authorEd Morley <emorley@mozilla.com>
Thu, 07 Mar 2013 13:03:39 +0000
changeset 124103 1d229425d5d30992673c0a0d88276c51f64709cd
parent 124102 408973dba4ebd3e525a92e7de50f2d4b0666150b
child 124104 7f0a4a8f2013aadb607d73a3c24f8455575f40e2
push id1405
push userryanvm@gmail.com
push dateThu, 07 Mar 2013 22:41:28 +0000
treeherderfx-team@6deb17bc6c56 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs848395
milestone22.0a1
backs oute112b04664a6f6dfd47e0f2b6f67078e2a0d1671
Backed out changeset e112b04664a6 (bug 848395)
js/src/gdb/gdb-tests.cpp
js/src/gdb/mozilla/Root.py
js/src/gdb/mozilla/jsid.py
js/src/gdb/tests/test-JSObject.cpp
js/src/gdb/tests/test-JSString.cpp
js/src/gdb/tests/test-Root-null.py
js/src/gdb/tests/test-Root.cpp
js/src/gdb/tests/test-Root.py
js/src/gdb/tests/test-jsid.cpp
js/src/gdb/tests/test-jsval.cpp
js/src/jsapi-tests/selfTest.cpp
js/src/jsapi-tests/testAddPropertyPropcache.cpp
js/src/jsapi-tests/testArrayBuffer.cpp
js/src/jsapi-tests/testBindCallable.cpp
js/src/jsapi-tests/testBug604087.cpp
js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp
js/src/jsapi-tests/testChromeBuffer.cpp
js/src/jsapi-tests/testClassGetter.cpp
js/src/jsapi-tests/testCloneScript.cpp
js/src/jsapi-tests/testConservativeGC.cpp
js/src/jsapi-tests/testCustomIterator.cpp
js/src/jsapi-tests/testDebugger.cpp
js/src/jsapi-tests/testDeepFreeze.cpp
js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp
js/src/jsapi-tests/testDefineProperty.cpp
js/src/jsapi-tests/testErrorCopying.cpp
js/src/jsapi-tests/testFunctionProperties.cpp
js/src/jsapi-tests/testGCFinalizeCallback.cpp
js/src/jsapi-tests/testGCOutOfMemory.cpp
js/src/jsapi-tests/testGetPropertyDefault.cpp
js/src/jsapi-tests/testIntString.cpp
js/src/jsapi-tests/testIntern.cpp
js/src/jsapi-tests/testJSEvaluateScript.cpp
js/src/jsapi-tests/testLookup.cpp
js/src/jsapi-tests/testLooselyEqual.cpp
js/src/jsapi-tests/testNewObject.cpp
js/src/jsapi-tests/testOOM.cpp
js/src/jsapi-tests/testObjectEmulatingUndefined.cpp
js/src/jsapi-tests/testOps.cpp
js/src/jsapi-tests/testOriginPrincipals.cpp
js/src/jsapi-tests/testParseJSON.cpp
js/src/jsapi-tests/testProfileStrings.cpp
js/src/jsapi-tests/testRegExp.cpp
js/src/jsapi-tests/testResolveRecursion.cpp
js/src/jsapi-tests/testScriptInfo.cpp
js/src/jsapi-tests/testScriptObject.cpp
js/src/jsapi-tests/testSetProperty.cpp
js/src/jsapi-tests/testStringBuffer.cpp
js/src/jsapi-tests/testTrap.cpp
js/src/jsapi-tests/testTypedArrays.cpp
js/src/jsapi-tests/testValueABI.cpp
js/src/jsapi-tests/testVersion.cpp
js/src/jsapi-tests/testXDR.cpp
js/src/jsapi-tests/tests.cpp
js/src/jsapi-tests/tests.h
js/src/jsclone.h
js/src/jsfun.h
js/src/jsinferinlines.h
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/jsprvtd.h
js/src/perf/jsperf.cpp
js/src/shell/js.cpp
js/src/vm/String-inl.h
--- a/js/src/gdb/gdb-tests.cpp
+++ b/js/src/gdb/gdb-tests.cpp
@@ -63,17 +63,17 @@ main (int argc, const char **argv)
 
     JSContext *cx = checkPtr(JS_NewContext(runtime, 8192));
     JS_SetVersion(cx, JSVERSION_LATEST);
     JS_SetErrorReporter(cx, reportError);
 
     JSAutoRequest ar(cx);
 
     /* Create the global object. */
-    RootedObject global(cx, checkPtr(JS_NewGlobalObject(cx, &global_class, NULL)));
+    js::RootedObject global(cx, checkPtr(JS_NewGlobalObject(cx, &global_class, NULL)));
     JS_SetGlobalObject(cx, global);
 
     JSAutoCompartment ac(cx, global);
 
     /* Populate the global object with the standard globals,
        like Object and Array. */
     checkBool(JS_InitStandardClasses(cx, global));
 
--- a/js/src/gdb/mozilla/Root.py
+++ b/js/src/gdb/mozilla/Root.py
@@ -21,22 +21,22 @@ class Common(object):
     # Initialize a pretty-printer for |value|, using |cache|.
     #
     # If given, |content_printer| is a pretty-printer constructor to use for
     # this handle/root/etc.'s referent. Usually, we can just omit this argument
     # and let GDB choose a pretty-printer for the referent given its type, but
     # when the referent is a typedef of an integral type (say, |jsid| in a
     # non-|DEBUG| build), the GNU toolchain (at least) loses the typedef name,
     # and all we know about the referent is its fundamental integer type ---
-    # |JS::Rooted<jsid>|, for example, appears in GDB as |JS::Rooted<long>| ---
+    # |js::Rooted<jsid>|, for example, appears in GDB as |js::Rooted<long>| ---
     # and we are left with no way to choose a meaningful pretty-printer based on
     # the type of the referent alone. However, because we know that the only
-    # integer type for which |JS::Rooted| is likely to be instantiated is
+    # integer type for which |js::Rooted| is likely to be instantiated is
     # |jsid|, we *can* register a pretty-printer constructor for the full
-    # instantiation |JS::Rooted<long>|. That constructor creates a |JS::Rooted|
+    # instantiation |js::Rooted<long>|. That constructor creates a |js::Rooted|
     # pretty-printer, and explicitly specifies the constructor for the referent,
     # using this initializer's |content_printer| argument.
     def __init__(self, value, cache, content_printer=None):
         self.value = value
         self.cache = cache
         self.content_printer = content_printer
     def to_string(self):
         ptr = self.value[self.member]
@@ -46,17 +46,17 @@ class Common(object):
             return self.content_printer(ptr, self.cache).to_string()
         else:
             # As of 2012-11, GDB suppresses printing pointers in replacement
             # values; see http://sourceware.org/ml/gdb/2012-11/msg00055.html
             # That means that simply returning the 'ptr' member won't work.
             # Instead, just invoke GDB's formatter ourselves.
             return str(ptr)
 
-@template_pretty_printer("JS::Rooted")
+@template_pretty_printer("js::Rooted")
 class Rooted(Common):
     pass
 
 @template_pretty_printer("JS::Handle")
 class Handle(Common):
     handle = True
 
 @template_pretty_printer("JS::MutableHandle")
@@ -73,14 +73,14 @@ class EncapsulatedValue(Common):
 
 # Return the referent of a HeapPtr, Rooted, or Handle.
 def deref(root):
     tag = root.type.strip_typedefs().tag
     if not tag:
         raise TypeError, "Can't dereference type with no structure tag: %s" % (root.type,)
     elif tag.startswith('js::HeapPtr<'):
         return root['value']
-    elif tag.startswith('JS::Rooted<'):
+    elif tag.startswith('js::Rooted<'):
         return root['ptr']
-    elif tag.startswith('JS::Handle<'):
+    elif tag.startswith('js::Handle<'):
         return root['ptr']
     else:
         raise NotImplementedError
--- a/js/src/gdb/mozilla/jsid.py
+++ b/js/src/gdb/mozilla/jsid.py
@@ -51,17 +51,17 @@ class jsid(object):
             body = ((bits & ~jsid.TYPE_MASK)
                     .cast(self.cache.JSObject_ptr_t))
         else:
             body = "<unrecognized>"
         return '$jsid(%s)' % (body,)
 
 # Hard-code the referent type pretty-printer for jsid roots and handles.
 # See the comment for mozilla.Root.Common.__init__.
-@pretty_printer('JS::Rooted<long>')
+@pretty_printer('js::Rooted<long>')
 def RootedJSID(value, cache):
     return mozilla.Root.Rooted(value, cache, jsid)
 @pretty_printer('JS::Handle<long>')
 def HandleJSID(value, cache):
     return mozilla.Root.Handle(value, cache, jsid)
 @pretty_printer('JS::MutableHandle<long>')
 def MutableHandleJSID(value, cache):
     return mozilla.Root.MutableHandle(value, cache, jsid)
--- a/js/src/gdb/tests/test-JSObject.cpp
+++ b/js/src/gdb/tests/test-JSObject.cpp
@@ -1,18 +1,18 @@
 #include "gdb-tests.h"
 
 FRAGMENT(JSObject, simple) {
-  JS::Rooted<JSObject *> glob(cx, JS_GetGlobalObject(cx));
-  JS::Rooted<JSObject *> plain(cx, JS_NewObject(cx, 0, 0, 0));
-  JS::Rooted<JSObject *> func(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
+  js::Rooted<JSObject *> glob(cx, JS_GetGlobalObject(cx));
+  js::Rooted<JSObject *> plain(cx, JS_NewObject(cx, 0, 0, 0));
+  js::Rooted<JSObject *> func(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
                                                               JS_GetGlobalObject(cx), "dys"));
-  JS::Rooted<JSObject *> anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
+  js::Rooted<JSObject *> anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
                                                               JS_GetGlobalObject(cx), 0));
-  JS::Rooted<JSFunction *> funcPtr(cx, JS_NewFunction(cx, (JSNative) 1, 0, 0,
+  js::Rooted<JSFunction *> funcPtr(cx, JS_NewFunction(cx, (JSNative) 1, 0, 0,
                                                       JS_GetGlobalObject(cx), "formFollows"));
 
   JSObject &plainRef = *plain;
   JSFunction &funcRef = *funcPtr;
   js::RawObject plainRaw = plain;
   js::RawObject funcRaw = func;
 
   breakpoint();
@@ -24,16 +24,16 @@ FRAGMENT(JSObject, simple) {
   (void) funcPtr;
   (void) &plainRef;
   (void) &funcRef;
   (void) plainRaw;
   (void) funcRaw;
 }
 
 FRAGMENT(JSObject, null) {
-  JS::Rooted<JSObject *> null(cx, NULL);
+  js::Rooted<JSObject *> null(cx, NULL);
   js::RawObject nullRaw = null;
 
   breakpoint();
 
   (void) null;
   (void) nullRaw;
 }
--- a/js/src/gdb/tests/test-JSString.cpp
+++ b/js/src/gdb/tests/test-JSString.cpp
@@ -1,59 +1,59 @@
 #include "gdb-tests.h"
 #include "jsatom.h"
 
 // When JSGC_ANALYSIS is #defined, Rooted<JSFlatString*> needs the definition
 // of JSFlatString in order to figure out its ThingRootKind
 #include "vm/String.h"
 
 FRAGMENT(JSString, simple) {
-  JS::Rooted<JSString *> empty(cx, JS_NewStringCopyN(cx, NULL, 0));
-  JS::Rooted<JSString *> x(cx, JS_NewStringCopyN(cx, "x", 1));
-  JS::Rooted<JSString *> z(cx, JS_NewStringCopyZ(cx, "z"));
+  js::Rooted<JSString *> empty(cx, JS_NewStringCopyN(cx, NULL, 0));
+  js::Rooted<JSString *> x(cx, JS_NewStringCopyN(cx, "x", 1));
+  js::Rooted<JSString *> z(cx, JS_NewStringCopyZ(cx, "z"));
 
   // I expect this will be a non-inlined string.
-  JS::Rooted<JSString *> stars(cx, JS_NewStringCopyZ(cx,
+  js::Rooted<JSString *> stars(cx, JS_NewStringCopyZ(cx,
                                                      "*************************"
                                                      "*************************"
                                                      "*************************"
                                                      "*************************"));
 
   // This may well be an inlined string.
-  JS::Rooted<JSString *> xz(cx, JS_ConcatStrings(cx, x, z));
+  js::Rooted<JSString *> xz(cx, JS_ConcatStrings(cx, x, z));
 
   // This will probably be a rope.
-  JS::Rooted<JSString *> doubleStars(cx, JS_ConcatStrings(cx, stars, stars));
+  js::Rooted<JSString *> doubleStars(cx, JS_ConcatStrings(cx, stars, stars));
 
   // Ensure we're not confused by typedefs for pointer types.
   js::RawString xRaw = x;
 
   breakpoint();
 
   (void) empty;
   (void) x;
   (void) z;
   (void) stars;
   (void) xz;
   (void) doubleStars;
   (void) xRaw;
 }
 
 FRAGMENT(JSString, null) {
-  JS::Rooted<JSString *> null(cx, NULL);
+  js::Rooted<JSString *> null(cx, NULL);
   js::RawString nullRaw = null;
 
   breakpoint();
 
   (void) null;
   (void) nullRaw;
 }
 
 FRAGMENT(JSString, subclasses) {
-  JS::Rooted<JSFlatString *> flat(cx, JS_FlattenString(cx, JS_NewStringCopyZ(cx, "Hi!")));
+  js::Rooted<JSFlatString *> flat(cx, JS_FlattenString(cx, JS_NewStringCopyZ(cx, "Hi!")));
 
   breakpoint();
 
   (void) flat;
 }
 
 FRAGMENT(JSString, atom) {
   JSAtom *molybdenum = js::Atomize(cx, "molybdenum", 10);
--- a/js/src/gdb/tests/test-Root-null.py
+++ b/js/src/gdb/tests/test-Root-null.py
@@ -1,20 +1,20 @@
 # Test printing roots that refer to NULL pointers.
 
 # Since mozilla.prettyprinters.Pointer declines to create pretty-printers
 # for null pointers, GDB built-in printing code ends up handling them. But
 # as of 2012-11, GDB suppresses printing pointers in replacement values:
 # see: http://sourceware.org/ml/gdb/2012-11/msg00055.html
 #
-# Thus, if the pretty-printer for JS::Rooted simply returns the referent as
+# Thus, if the pretty-printer for js::Rooted simply returns the referent as
 # a replacement value (which seems reasonable enough, if you want the
 # pretty-printer to be completely transparent), and the referent is a null
 # pointer, it prints as nothing at all.
 #
-# This test ensures that the JS::Rooted pretty-printer doesn't make that
+# This test ensures that the js::Rooted pretty-printer doesn't make that
 # mistake.
 
 gdb.execute('set print address on')
 
 run_fragment('Root.null')
 
 assert_pretty('null', '0x0')
--- a/js/src/gdb/tests/test-Root.cpp
+++ b/js/src/gdb/tests/test-Root.cpp
@@ -1,33 +1,33 @@
 #include "gdb-tests.h"
 
 FRAGMENT(Root, null) {
-  JS::Rooted<JSObject *> null(cx, NULL);
+  js::Rooted<JSObject *> null(cx, NULL);
 
   breakpoint();
 
   (void) null;
 }
 
 void callee(JS::Handle<JSObject *> obj, JS::MutableHandle<JSObject *> mutableObj)
 {
   // Prevent the linker from unifying this function with others that are
   // equivalent in machine code but not type.
   fprintf(stderr, "Called " __FILE__ ":callee\n");
   breakpoint();
 }
 
 FRAGMENT(Root, handle) {
-  JS::Rooted<JSObject *> global(cx, JS_GetGlobalObject(cx));
+  js::Rooted<JSObject *> global(cx, JS_GetGlobalObject(cx));
   callee(global, &global);
   (void) global;
 }
 
 FRAGMENT(Root, HeapSlot) {
-  JS::Rooted<jsval> plinth(cx, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, "plinth")));
-  JS::Rooted<JSObject *> array(cx, JS_NewArrayObject(cx, 1, plinth.address()));
+  js::Rooted<jsval> plinth(cx, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, "plinth")));
+  js::Rooted<JSObject *> array(cx, JS_NewArrayObject(cx, 1, plinth.address()));
 
   breakpoint();
 
   (void) plinth;
   (void) array;
 }
--- a/js/src/gdb/tests/test-Root.py
+++ b/js/src/gdb/tests/test-Root.py
@@ -1,11 +1,11 @@
 # Test printing Handles.
 
-assert_subprinter_registered('SpiderMonkey', 'instantiations-of-JS::Rooted')
+assert_subprinter_registered('SpiderMonkey', 'instantiations-of-js::Rooted')
 assert_subprinter_registered('SpiderMonkey', 'instantiations-of-JS::Handle')
 assert_subprinter_registered('SpiderMonkey', 'instantiations-of-JS::MutableHandle')
 assert_subprinter_registered('SpiderMonkey', 'instantiations-of-js::EncapsulatedPtr')
 assert_subprinter_registered('SpiderMonkey', 'js::EncapsulatedValue')
 
 run_fragment('Root.handle')
 
 assert_pretty('obj', '(JSObject * const)  [object global] delegate')
--- a/js/src/gdb/tests/test-jsid.cpp
+++ b/js/src/gdb/tests/test-jsid.cpp
@@ -1,17 +1,17 @@
 #include "gdb-tests.h"
 
 FRAGMENT(jsid, simple) {
-  JS::Rooted<JSString *> string(cx, JS_NewStringCopyZ(cx, "moon"));
-  JS::Rooted<JSString *> interned(cx, JS_InternJSString(cx, string));
-  JS::Rooted<jsid> string_id(cx, INTERNED_STRING_TO_JSID(cx, interned));
+  js::Rooted<JSString *> string(cx, JS_NewStringCopyZ(cx, "moon"));
+  js::Rooted<JSString *> interned(cx, JS_InternJSString(cx, string));
+  js::Rooted<jsid> string_id(cx, INTERNED_STRING_TO_JSID(cx, interned));
   jsid int_id = INT_TO_JSID(1729);
   jsid void_id = JSID_VOID;
-  JS::Rooted<jsid> object_id(cx, OBJECT_TO_JSID(JS_GetGlobalObject(cx)));
+  js::Rooted<jsid> object_id(cx, OBJECT_TO_JSID(JS_GetGlobalObject(cx)));
 
   breakpoint();
 
   (void) string;
   (void) interned;
   (void) string_id;
   (void) int_id;
   (void) void_id;
@@ -24,13 +24,13 @@ jsid_handles(JS::Handle<jsid> jsid_handl
 {
   // Prevent the linker from unifying this function with others that are
   // equivalent in machine code but not type.
   fprintf(stderr, "Called " __FILE__ ":jsid_handles\n");
   breakpoint();
 }
 
 FRAGMENT(jsid, handles) {
-  JS::Rooted<JSString *> string(cx, JS_NewStringCopyZ(cx, "shovel"));
-  JS::Rooted<JSString *> interned(cx, JS_InternJSString(cx, string));
-  JS::Rooted<jsid> string_id(cx, INTERNED_STRING_TO_JSID(cx, interned));
+  js::Rooted<JSString *> string(cx, JS_NewStringCopyZ(cx, "shovel"));
+  js::Rooted<JSString *> interned(cx, JS_InternJSString(cx, string));
+  js::Rooted<jsid> string_id(cx, INTERNED_STRING_TO_JSID(cx, interned));
   jsid_handles(string_id, &string_id);
 }
--- a/js/src/gdb/tests/test-jsval.cpp
+++ b/js/src/gdb/tests/test-jsval.cpp
@@ -1,29 +1,29 @@
 #include "gdb-tests.h"
 
 FRAGMENT(jsval, simple) {
-  JS::Rooted<jsval> fortytwo(cx, INT_TO_JSVAL(42));
-  JS::Rooted<jsval> negone(cx, INT_TO_JSVAL(-1));
-  JS::Rooted<jsval> undefined(cx, JSVAL_VOID);
-  JS::Rooted<jsval> null(cx, JSVAL_NULL);
-  JS::Rooted<jsval> js_true(cx, JSVAL_TRUE);
-  JS::Rooted<jsval> js_false(cx, JSVAL_FALSE);
-  JS::Rooted<jsval> elements_hole(cx, js::MagicValue(JS_ELEMENTS_HOLE));
+  js::Rooted<jsval> fortytwo(cx, INT_TO_JSVAL(42));
+  js::Rooted<jsval> negone(cx, INT_TO_JSVAL(-1));
+  js::Rooted<jsval> undefined(cx, JSVAL_VOID);
+  js::Rooted<jsval> null(cx, JSVAL_NULL);
+  js::Rooted<jsval> js_true(cx, JSVAL_TRUE);
+  js::Rooted<jsval> js_false(cx, JSVAL_FALSE);
+  js::Rooted<jsval> elements_hole(cx, js::MagicValue(JS_ELEMENTS_HOLE));
 
-  JS::Rooted<jsval> empty_string(cx);
+  js::Rooted<jsval> empty_string(cx);
   empty_string.setString(JS_NewStringCopyZ(cx, ""));
-  JS::Rooted<jsval> friendly_string(cx);
+  js::Rooted<jsval> friendly_string(cx);
   friendly_string.setString(JS_NewStringCopyZ(cx, "Hello!"));
 
-  JS::Rooted<jsval> global(cx);
+  js::Rooted<jsval> global(cx);
   global.setObject(*JS_GetGlobalObject(cx));
 
   // Some interesting value that floating-point won't munge.
-  JS::Rooted<jsval> onehundredthirtysevenonehundredtwentyeighths(cx, DOUBLE_TO_JSVAL(137.0 / 128.0));
+  js::Rooted<jsval> onehundredthirtysevenonehundredtwentyeighths(cx, DOUBLE_TO_JSVAL(137.0 / 128.0));
 
   breakpoint();
 
   (void) fortytwo;
   (void) negone;
   (void) undefined;
   (void) js_true;
   (void) js_false;
--- a/js/src/jsapi-tests/selfTest.cpp
+++ b/js/src/jsapi-tests/selfTest.cpp
@@ -5,17 +5,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "tests.h"
 
 BEGIN_TEST(selfTest_NaNsAreSame)
 {
-    JS::RootedValue v1(cx), v2(cx);
+    js::RootedValue v1(cx), v2(cx);
     EVAL("0/0", v1.address());  // NaN
     CHECK_SAME(v1, v1);
 
     EVAL("Math.sin('no')", v2.address());  // also NaN
     CHECK_SAME(v1, v2);
     return true;
 }
 END_TEST(selfTest_NaNsAreSame)
--- a/js/src/jsapi-tests/testAddPropertyPropcache.cpp
+++ b/js/src/jsapi-tests/testAddPropertyPropcache.cpp
@@ -29,35 +29,35 @@ JSClass addPropertyClass = {
     JS_StrictPropertyStub,   /* setProperty */
     JS_EnumerateStub,
     JS_ResolveStub,
     JS_ConvertStub
 };
 
 BEGIN_TEST(testAddPropertyHook)
 {
-    JS::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
+    js::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
     CHECK(obj);
-    JS::RootedValue proto(cx, OBJECT_TO_JSVAL(obj));
+    js::RootedValue proto(cx, OBJECT_TO_JSVAL(obj));
     JS_InitClass(cx, global, obj, &addPropertyClass, NULL, 0, NULL, NULL, NULL,
                  NULL);
 
     obj = JS_NewArrayObject(cx, 0, NULL);
     CHECK(obj);
-    JS::RootedValue arr(cx, OBJECT_TO_JSVAL(obj));
+    js::RootedValue arr(cx, OBJECT_TO_JSVAL(obj));
 
     CHECK(JS_DefineProperty(cx, global, "arr", arr,
                             JS_PropertyStub, JS_StrictPropertyStub,
                             JSPROP_ENUMERATE));
 
     for (int i = 0; i < expectedCount; ++i) {
         obj = JS_NewObject(cx, &addPropertyClass, NULL, NULL);
         CHECK(obj);
-        JS::RootedValue vobj(cx, OBJECT_TO_JSVAL(obj));
-        JS::RootedObject arrObj(cx, JSVAL_TO_OBJECT(arr));
+        js::RootedValue vobj(cx, OBJECT_TO_JSVAL(obj));
+        js::RootedObject arrObj(cx, JSVAL_TO_OBJECT(arr));
         CHECK(JS_DefineElement(cx, arrObj, i, vobj,
                                JS_PropertyStub, JS_StrictPropertyStub,
                                JSPROP_ENUMERATE));
     }
 
     // Now add a prop to each of the objects, but make sure to do
     // so at the same bytecode location so we can hit the propcache.
     EXEC("'use strict';                                     \n"
--- a/js/src/jsapi-tests/testArrayBuffer.cpp
+++ b/js/src/jsapi-tests/testArrayBuffer.cpp
@@ -6,18 +6,18 @@
 #include "jsfriendapi.h"
 
 #define NUM_TEST_BUFFERS 2
 #define MAGIC_VALUE_1 3
 #define MAGIC_VALUE_2 17
 
 BEGIN_TEST(testArrayBuffer_bug720949_steal)
 {
-    JS::RootedObject buf_len1(cx), buf_len200(cx);
-    JS::RootedObject tarray_len1(cx), tarray_len200(cx);
+    js::RootedObject buf_len1(cx), buf_len200(cx);
+    js::RootedObject tarray_len1(cx), tarray_len200(cx);
 
     uint32_t sizes[NUM_TEST_BUFFERS] = { sizeof(uint32_t), 200 * sizeof(uint32_t) };
     JS::HandleObject testBuf[NUM_TEST_BUFFERS] = { buf_len1, buf_len200 };
     JS::HandleObject testArray[NUM_TEST_BUFFERS] = { tarray_len1, tarray_len200 };
 
     // Single-element ArrayBuffer (uses fixed slots for storage)
     CHECK(buf_len1 = JS_NewArrayBuffer(cx, sizes[0]));
     CHECK(tarray_len1 = JS_NewInt32ArrayWithBuffer(cx, testBuf[0], 0, -1));
@@ -28,17 +28,17 @@ BEGIN_TEST(testArrayBuffer_bug720949_ste
     // Many-element ArrayBuffer (uses dynamic storage)
     CHECK(buf_len200 = JS_NewArrayBuffer(cx, 200 * sizeof(uint32_t)));
     CHECK(tarray_len200 = JS_NewInt32ArrayWithBuffer(cx, testBuf[1], 0, -1));
 
     for (unsigned i = 0; i < NUM_TEST_BUFFERS; i++) {
         JS::HandleObject obj = testBuf[i];
         JS::HandleObject view = testArray[i];
         uint32_t size = sizes[i];
-        JS::RootedValue v(cx);
+        js::RootedValue v(cx);
 
         // Byte lengths should all agree
         CHECK(JS_IsArrayBufferObject(obj));
         CHECK_EQUAL(JS_GetArrayBufferByteLength(obj), size);
         JS_GetProperty(cx, obj, "byteLength", v.address());
         CHECK_SAME(v, INT_TO_JSVAL(size));
         JS_GetProperty(cx, view, "byteLength", v.address());
         CHECK_SAME(v, INT_TO_JSVAL(size));
@@ -67,21 +67,21 @@ BEGIN_TEST(testArrayBuffer_bug720949_ste
         CHECK(JS_GetProperty(cx, view, "length", v.address()));
         CHECK_SAME(v, INT_TO_JSVAL(0));
         CHECK_EQUAL(JS_GetArrayBufferByteLength(obj), 0);
         v = JSVAL_VOID;
         JS_GetElement(cx, obj, 0, v.address());
         CHECK_SAME(v, JSVAL_VOID);
 
         // Transfer to a new ArrayBuffer
-        JS::RootedObject dst(cx, JS_NewArrayBufferWithContents(cx, contents));
+        js::RootedObject dst(cx, JS_NewArrayBufferWithContents(cx, contents));
         CHECK(JS_IsArrayBufferObject(dst));
         data = JS_GetArrayBufferData(obj);
 
-        JS::RootedObject dstview(cx, JS_NewInt32ArrayWithBuffer(cx, dst, 0, -1));
+        js::RootedObject dstview(cx, JS_NewInt32ArrayWithBuffer(cx, dst, 0, -1));
         CHECK(dstview != NULL);
 
         CHECK_EQUAL(JS_GetArrayBufferByteLength(dst), size);
         data = JS_GetArrayBufferData(dst);
         CHECK(data != NULL);
         CHECK_EQUAL(*reinterpret_cast<uint32_t*>(data), MAGIC_VALUE_2);
         CHECK(JS_GetElement(cx, dstview, 0, v.address()));
         CHECK_SAME(v, INT_TO_JSVAL(MAGIC_VALUE_2));
@@ -95,27 +95,27 @@ static void GC(JSContext *cx)
 {
     JS_GC(JS_GetRuntime(cx));
     JS_GC(JS_GetRuntime(cx)); // Trigger another to wait for background finalization to end
 }
 
 // Varying number of views of a buffer, to test the neutering weak pointers
 BEGIN_TEST(testArrayBuffer_bug720949_viewList)
 {
-    JS::RootedObject buffer(cx);
+    js::RootedObject buffer(cx);
 
     // No views
     buffer = JS_NewArrayBuffer(cx, 2000);
     buffer = NULL;
     GC(cx);
 
     // One view.
     {
         buffer = JS_NewArrayBuffer(cx, 2000);
-        JS::RootedObject view(cx, JS_NewUint8ArrayWithBuffer(cx, buffer, 0, -1));
+        js::RootedObject view(cx, JS_NewUint8ArrayWithBuffer(cx, buffer, 0, -1));
         void *contents;
         uint8_t *data;
         CHECK(JS_StealArrayBufferContents(cx, buffer, &contents, &data));
         CHECK(contents != NULL);
         CHECK(data != NULL);
         JS_free(NULL, contents);
         GC(cx);
         CHECK(isNeutered(view));
@@ -125,18 +125,18 @@ BEGIN_TEST(testArrayBuffer_bug720949_vie
         buffer = NULL;
         GC(cx);
     }
 
     // Two views
     {
         buffer = JS_NewArrayBuffer(cx, 2000);
 
-        JS::RootedObject view1(cx, JS_NewUint8ArrayWithBuffer(cx, buffer, 0, -1));
-        JS::RootedObject view2(cx, JS_NewUint8ArrayWithBuffer(cx, buffer, 1, 200));
+        js::RootedObject view1(cx, JS_NewUint8ArrayWithBuffer(cx, buffer, 0, -1));
+        js::RootedObject view2(cx, JS_NewUint8ArrayWithBuffer(cx, buffer, 1, 200));
 
         // Remove, re-add a view
         view2 = NULL;
         GC(cx);
         view2 = JS_NewUint8ArrayWithBuffer(cx, buffer, 1, 200);
 
         // Neuter
         void *contents;
@@ -157,13 +157,13 @@ BEGIN_TEST(testArrayBuffer_bug720949_vie
         buffer = NULL;
         GC(cx);
     }
 
     return true;
 }
 
 bool isNeutered(JS::HandleObject obj) {
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     return JS_GetProperty(cx, obj, "byteLength", v.address()) && v.toInt32() == 0;
 }
 
 END_TEST(testArrayBuffer_bug720949_viewList)
--- a/js/src/jsapi-tests/testBindCallable.cpp
+++ b/js/src/jsapi-tests/testBindCallable.cpp
@@ -1,30 +1,30 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "tests.h"
 
 BEGIN_TEST(test_BindCallable)
 {
-  JS::RootedValue v(cx);
+  js::RootedValue v(cx);
   EVAL("({ somename : 1717 })", v.address());
   CHECK(v.isObject());
 
-  JS::RootedValue func(cx);
+  js::RootedValue func(cx);
   EVAL("(function() { return this.somename; })", func.address());
   CHECK(func.isObject());
 
-  JS::RootedObject funcObj(cx, JSVAL_TO_OBJECT(func));
-  JS::RootedObject vObj(cx, JSVAL_TO_OBJECT(v));
+  js::RootedObject funcObj(cx, JSVAL_TO_OBJECT(func));
+  js::RootedObject vObj(cx, JSVAL_TO_OBJECT(v));
   JSObject* newCallable = JS_BindCallable(cx, funcObj, vObj);
   CHECK(newCallable);
 
-  JS::RootedValue retval(cx);
+  js::RootedValue retval(cx);
   bool called = JS_CallFunctionValue(cx, NULL, OBJECT_TO_JSVAL(newCallable), 0, NULL, retval.address());
   CHECK(called);
 
   CHECK(JSVAL_IS_INT(retval));
 
   CHECK(JSVAL_TO_INT(retval) == 1717);
   return true;
 }
--- a/js/src/jsapi-tests/testBug604087.cpp
+++ b/js/src/jsapi-tests/testBug604087.cpp
@@ -31,71 +31,71 @@ struct OuterWrapper : js::Wrapper
 
 OuterWrapper
 OuterWrapper::singleton;
 
 static JSObject *
 wrap(JSContext *cx, JS::HandleObject toWrap, JS::HandleObject target)
 {
     JSAutoCompartment ac(cx, target);
-    JS::RootedObject wrapper(cx, toWrap);
+    js::RootedObject wrapper(cx, toWrap);
     if (!JS_WrapObject(cx, wrapper.address()))
         return NULL;
     return wrapper;
 }
 
 static JSObject *
 SameCompartmentWrap(JSContext *cx, JSObject *objArg)
 {
-    JS::RootedObject obj(cx, objArg);
+    js::RootedObject obj(cx, objArg);
     JS_GC(JS_GetRuntime(cx));
     return obj;
 }
 
 static JSObject *
 PreWrap(JSContext *cx, JSObject *scopeArg, JSObject *objArg, unsigned flags)
 {
-    JS::RootedObject scope(cx, scopeArg);
-    JS::RootedObject obj(cx, objArg);
+    js::RootedObject scope(cx, scopeArg);
+    js::RootedObject obj(cx, objArg);
     JS_GC(JS_GetRuntime(cx));
     return obj;
 }
 
 static JSObject *
 Wrap(JSContext *cx, JSObject *existing, JSObject *objArg,
      JSObject *protoArg, JSObject *parentArg, unsigned flags)
 {
-    JS::RootedObject obj(cx, objArg);
-    JS::RootedObject proto(cx, protoArg);
-    JS::RootedObject parent(cx, parentArg);
+    js::RootedObject obj(cx, objArg);
+    js::RootedObject proto(cx, protoArg);
+    js::RootedObject parent(cx, parentArg);
     return js::Wrapper::New(cx, obj, proto, parent, &js::CrossCompartmentWrapper::singleton);
 }
 
 BEGIN_TEST(testBug604087)
 {
-    JS::RootedObject outerObj(cx, js::Wrapper::New(cx, global, global->getProto(), global,
+    js::RootedObject outerObj(cx, js::Wrapper::New(cx, global, global->getProto(), global,
                                                &OuterWrapper::singleton));
-    JS::RootedObject compartment2(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
-    JS::RootedObject compartment3(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
-    JS::RootedObject compartment4(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
+    js::RootedObject compartment2(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
+    js::RootedObject compartment3(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
+    js::RootedObject compartment4(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
 
-    JS::RootedObject c2wrapper(cx, wrap(cx, outerObj, compartment2));
+    js::RootedObject c2wrapper(cx, wrap(cx, outerObj, compartment2));
     CHECK(c2wrapper);
     js::SetProxyExtra(c2wrapper, 0, js::Int32Value(2));
 
-    JS::RootedObject c3wrapper(cx, wrap(cx, outerObj, compartment3));
+    js::RootedObject c3wrapper(cx, wrap(cx, outerObj, compartment3));
     CHECK(c3wrapper);
     js::SetProxyExtra(c3wrapper, 0, js::Int32Value(3));
 
-    JS::RootedObject c4wrapper(cx, wrap(cx, outerObj, compartment4));
+    js::RootedObject c4wrapper(cx, wrap(cx, outerObj, compartment4));
     CHECK(c4wrapper);
     js::SetProxyExtra(c4wrapper, 0, js::Int32Value(4));
     compartment4 = c4wrapper = NULL;
 
-    JS::RootedObject next(cx);
+    js::RootedObject next(cx);
     {
         JSAutoCompartment ac(cx, compartment2);
         next = js::Wrapper::New(cx, compartment2, compartment2->getProto(), compartment2,
                                 &OuterWrapper::singleton);
         CHECK(next);
     }
 
     JS_SetWrapObjectCallbacks(JS_GetRuntime(cx), Wrap, SameCompartmentWrap, PreWrap);
--- a/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp
+++ b/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp
@@ -39,51 +39,51 @@ CustomMethod(JSContext *cx, unsigned arg
 {
   CallArgs args = CallArgsFromVp(argc, vp);
   return CallNonGenericMethod(cx, IsCustomClass, CustomMethodImpl, args);
 }
 
 BEGIN_TEST(test_CallNonGenericMethodOnProxy)
 {
   // Create the first global object and compartment
-  JS::RootedObject globalA(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
+  js::RootedObject globalA(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
   CHECK(globalA);
 
-  JS::RootedObject customA(cx, JS_NewObject(cx, &CustomClass, NULL, NULL));
+  js::RootedObject customA(cx, JS_NewObject(cx, &CustomClass, NULL, NULL));
   CHECK(customA);
   JS_SetReservedSlot(customA, CUSTOM_SLOT, Int32Value(17));
 
   JSFunction *customMethodA = JS_NewFunction(cx, CustomMethod, 0, 0, customA, "customMethodA");
   CHECK(customMethodA);
 
-  JS::RootedValue rval(cx);
+  js::RootedValue rval(cx);
   CHECK(JS_CallFunction(cx, customA, customMethodA, 0, NULL, rval.address()));
   CHECK_SAME(rval, Int32Value(17));
 
   // Now create the second global object and compartment...
   {
-    JS::RootedObject globalB(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
+    js::RootedObject globalB(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
     CHECK(globalB);
 
     // ...and enter it.
     JSAutoCompartment enter(cx, globalB);
-    JS::RootedObject customB(cx, JS_NewObject(cx, &CustomClass, NULL, NULL));
+    js::RootedObject customB(cx, JS_NewObject(cx, &CustomClass, NULL, NULL));
     CHECK(customB);
     JS_SetReservedSlot(customB, CUSTOM_SLOT, Int32Value(42));
 
-    JS::RootedFunction customMethodB(cx, JS_NewFunction(cx, CustomMethod, 0, 0, customB, "customMethodB"));
+    js::RootedFunction customMethodB(cx, JS_NewFunction(cx, CustomMethod, 0, 0, customB, "customMethodB"));
     CHECK(customMethodB);
 
-    JS::RootedValue rval(cx);
+    js::RootedValue rval(cx);
     CHECK(JS_CallFunction(cx, customB, customMethodB, 0, NULL, rval.address()));
     CHECK_SAME(rval, Int32Value(42));
 
-    JS::RootedObject wrappedCustomA(cx, customA);
+    js::RootedObject wrappedCustomA(cx, customA);
     CHECK(JS_WrapObject(cx, wrappedCustomA.address()));
 
-    JS::RootedValue rval2(cx);
+    js::RootedValue rval2(cx);
     CHECK(JS_CallFunction(cx, wrappedCustomA, customMethodB, 0, NULL, rval2.address()));
     CHECK_SAME(rval, Int32Value(42));
   }
 
   return true;
 }
 END_TEST(test_CallNonGenericMethodOnProxy)
--- a/js/src/jsapi-tests/testChromeBuffer.cpp
+++ b/js/src/jsapi-tests/testChromeBuffer.cpp
@@ -65,29 +65,29 @@ BEGIN_TEST(testChromeBuffer)
             const char *bytes = "return x ? 1 + trusted(x-1) : 0";
             JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&trusted_glob);
             CHECK(fun = JS_CompileFunctionForPrincipals(cx, global, &system_principals,
                                                         "trusted", 1, &paramName, bytes, strlen(bytes),
                                                         "", 0));
             trusted_fun = JS_GetFunctionObject(fun);
         }
 
-        JS::RootedValue v(cx, JS::ObjectValue(*trusted_fun));
+        js::RootedValue v(cx, JS::ObjectValue(*trusted_fun));
         CHECK(JS_WrapValue(cx, v.address()));
 
         const char *paramName = "trusted";
         const char *bytes = "try {                                      "
                             "  return untrusted(trusted);               "
                             "} catch (e) {                              "
                             "  return trusted(100);                     "
                             "}                                          ";
         CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
                                        bytes, strlen(bytes), "", 0));
 
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         CHECK(JS_CallFunction(cx, NULL, fun, 1, v.address(), rval.address()));
         CHECK(JSVAL_TO_INT(rval) == 100);
     }
 
     /*
      * Check that content called from chrome in the reserved-buffer space
      * immediately ooms.
      */
@@ -102,29 +102,29 @@ BEGIN_TEST(testChromeBuffer)
                                 "}                                      ";
             JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&trusted_glob);
             CHECK(fun = JS_CompileFunctionForPrincipals(cx, global, &system_principals,
                                                         "trusted", 1, &paramName, bytes, strlen(bytes),
                                                         "", 0));
             trusted_fun = JS_GetFunctionObject(fun);
         }
 
-        JS::RootedValue v(cx, JS::ObjectValue(*trusted_fun));
+        js::RootedValue v(cx, JS::ObjectValue(*trusted_fun));
         CHECK(JS_WrapValue(cx, v.address()));
 
         const char *paramName = "trusted";
         const char *bytes = "try {                                      "
                             "  return untrusted(trusted);               "
                             "} catch (e) {                              "
                             "  return trusted(untrusted);               "
                             "}                                          ";
         CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
                                        bytes, strlen(bytes), "", 0));
 
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         CHECK(JS_CallFunction(cx, NULL, fun, 1, v.address(), rval.address()));
         JSBool match;
         CHECK(JS_StringEqualsAscii(cx, JSVAL_TO_STRING(rval), "From trusted: InternalError: too much recursion", &match));
         CHECK(match);
     }
 
     /*
      * Check that JS_SaveFrameChain called on the way from content to chrome
@@ -136,30 +136,30 @@ BEGIN_TEST(testChromeBuffer)
             const char *bytes = "return 42";
             JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&trusted_glob);
             CHECK(fun = JS_CompileFunctionForPrincipals(cx, global, &system_principals,
                                                         "trusted", 0, NULL, bytes, strlen(bytes),
                                                         "", 0));
             trusted_fun = JS_GetFunctionObject(fun);
         }
 
-        JS::RootedFunction fun(cx, JS_NewFunction(cx, CallTrusted, 0, 0, global, "callTrusted"));
-        JS::RootedObject callTrusted(cx, JS_GetFunctionObject(fun));
+        js::RootedFunction fun(cx, JS_NewFunction(cx, CallTrusted, 0, 0, global, "callTrusted"));
+        js::RootedObject callTrusted(cx, JS_GetFunctionObject(fun));
 
         const char *paramName = "f";
         const char *bytes = "try {                                      "
                             "  return untrusted(trusted);               "
                             "} catch (e) {                              "
                             "  return f();                              "
                             "}                                          ";
         CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
                                        bytes, strlen(bytes), "", 0));
 
-        JS::RootedValue arg(cx, JS::ObjectValue(*callTrusted));
-        JS::RootedValue rval(cx);
+        js::RootedValue arg(cx, JS::ObjectValue(*callTrusted));
+        js::RootedValue rval(cx);
         CHECK(JS_CallFunction(cx, NULL, fun, 1, arg.address(), rval.address()));
         CHECK(JSVAL_TO_INT(rval) == 42);
     }
 
     return true;
 }
 virtual void uninit() {
     JS_RemoveObjectRoot(cx, &trusted_glob);
--- a/js/src/jsapi-tests/testClassGetter.cpp
+++ b/js/src/jsapi-tests/testClassGetter.cpp
@@ -58,16 +58,16 @@ static JSFunctionSpec ptestFunctions[] =
 BEGIN_TEST(testClassGetter_isCalled)
 {
     CHECK(JS_InitClass(cx, global, NULL, &ptestClass, PTest, 0,
                        NULL, ptestFunctions, NULL, NULL));
 
     EXEC("function check() { var o = new PTest(); o.test_fn(); o.test_value1; o.test_value2; o.test_value1; }");
 
     for (int i = 1; i < 9; i++) {
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         CHECK(JS_CallFunctionName(cx, global, "check", 0, NULL, rval.address()));
         CHECK_SAME(INT_TO_JSVAL(called_test_fn), INT_TO_JSVAL(i));
         CHECK_SAME(INT_TO_JSVAL(called_test_prop_get), INT_TO_JSVAL(4 * i));
     }
     return true;
 }
 END_TEST(testClassGetter_isCalled)
--- a/js/src/jsapi-tests/testCloneScript.cpp
+++ b/js/src/jsapi-tests/testCloneScript.cpp
@@ -8,32 +8,32 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "tests.h"
 #include "jsdbgapi.h"
 
 BEGIN_TEST(test_cloneScript)
 {
-    JS::RootedObject A(cx, createGlobal());
-    JS::RootedObject B(cx, createGlobal());
+    js::RootedObject A(cx, createGlobal());
+    js::RootedObject B(cx, createGlobal());
 
     CHECK(A);
     CHECK(B);
 
     const char *source =
         "var i = 0;\n"
         "var sum = 0;\n"
         "while (i < 10) {\n"
         "    sum += i;\n"
         "    ++i;\n"
         "}\n"
         "(sum);\n";
 
-    JS::RootedObject obj(cx);
+    js::RootedObject obj(cx);
 
     // compile for A
     {
         JSAutoCompartment a(cx, A);
         JSFunction *fun;
         CHECK(fun = JS_CompileFunction(cx, A, "f", 0, NULL, source, strlen(source), __FILE__, 1));
         CHECK(obj = JS_GetFunctionObject(fun));
     }
@@ -85,57 +85,57 @@ BEGIN_TEST(test_cloneScriptWithPrincipal
 {
     JS_InitDestroyPrincipalsCallback(rt, DestroyPrincipals);
 
     JSPrincipals *principalsA = new Principals();
     AutoDropPrincipals dropA(rt, principalsA);
     JSPrincipals *principalsB = new Principals();
     AutoDropPrincipals dropB(rt, principalsB);
 
-    JS::RootedObject A(cx, createGlobal(principalsA));
-    JS::RootedObject B(cx, createGlobal(principalsB));
+    js::RootedObject A(cx, createGlobal(principalsA));
+    js::RootedObject B(cx, createGlobal(principalsB));
 
     CHECK(A);
     CHECK(B);
 
     const char *argnames[] = { "arg" };
     const char *source = "return function() { return arg; }";
 
-    JS::RootedObject obj(cx);
+    js::RootedObject obj(cx);
 
     // Compile in A
     {
         JSAutoCompartment a(cx, A);
-        JS::RootedFunction fun(cx, JS_CompileFunctionForPrincipals(cx, A, principalsA, "f",
+        js::RootedFunction fun(cx, JS_CompileFunctionForPrincipals(cx, A, principalsA, "f",
                                                                mozilla::ArrayLength(argnames), argnames,
                                                                source, strlen(source), __FILE__, 1));
         CHECK(fun);
 
         JSScript *script;
         CHECK(script = JS_GetFunctionScript(cx, fun));
 
         CHECK(JS_GetScriptPrincipals(script) == principalsA);
         CHECK(obj = JS_GetFunctionObject(fun));
     }
 
     // Clone into B
     {
         JSAutoCompartment b(cx, B);
-        JS::RootedObject cloned(cx);
+        js::RootedObject cloned(cx);
         CHECK(cloned = JS_CloneFunctionObject(cx, obj, B));
 
         JSFunction *fun;
         CHECK(fun = JS_ValueToFunction(cx, JS::ObjectValue(*cloned)));
 
         JSScript *script;
         CHECK(script = JS_GetFunctionScript(cx, fun));
 
         CHECK(JS_GetScriptPrincipals(script) == principalsB);
 
-        JS::RootedValue v(cx);
+        js::RootedValue v(cx);
         JS::Value args[] = { JS::Int32Value(1) };
         CHECK(JS_CallFunctionValue(cx, B, JS::ObjectValue(*cloned), 1, args, v.address()));
         CHECK(v.isObject());
 
         JSObject *funobj = &v.toObject();
         CHECK(JS_ObjectIsFunction(cx, funobj));
         CHECK(fun = JS_ValueToFunction(cx, v));
         CHECK(script = JS_GetFunctionScript(cx, fun));
--- a/js/src/jsapi-tests/testConservativeGC.cpp
+++ b/js/src/jsapi-tests/testConservativeGC.cpp
@@ -7,38 +7,38 @@
 #include "tests.h"
 #include "jsobj.h"
 #include "vm/String.h"
 
 #include "jsobjinlines.h"
 
 BEGIN_TEST(testConservativeGC)
 {
-    JS::RootedValue v2(cx);
+    js::RootedValue v2(cx);
     EVAL("({foo: 'bar'});", v2.address());
     CHECK(v2.isObject());
     char objCopy[sizeof(JSObject)];
     js_memcpy(&objCopy, JSVAL_TO_OBJECT(v2), sizeof(JSObject));
 
-    JS::RootedValue v3(cx);
+    js::RootedValue v3(cx);
     EVAL("String(Math.PI);", v3.address());
     CHECK(JSVAL_IS_STRING(v3));
     char strCopy[sizeof(JSString)];
     js_memcpy(&strCopy, JSVAL_TO_STRING(v3), sizeof(JSString));
 
-    JS::RootedValue tmp(cx);
+    js::RootedValue tmp(cx);
     EVAL("({foo2: 'bar2'});", tmp.address());
     CHECK(tmp.isObject());
-    JS::RootedObject obj2(cx, JSVAL_TO_OBJECT(tmp));
+    js::RootedObject obj2(cx, JSVAL_TO_OBJECT(tmp));
     char obj2Copy[sizeof(JSObject)];
     js_memcpy(&obj2Copy, obj2, sizeof(JSObject));
 
     EVAL("String(Math.sqrt(3));", tmp.address());
     CHECK(JSVAL_IS_STRING(tmp));
-    JS::RootedString str2(cx, JSVAL_TO_STRING(tmp));
+    js::RootedString str2(cx, JSVAL_TO_STRING(tmp));
     char str2Copy[sizeof(JSString)];
     js_memcpy(&str2Copy, str2, sizeof(JSString));
 
     tmp = JSVAL_NULL;
 
     JS_GC(rt);
 
     EVAL("var a = [];\n"
--- a/js/src/jsapi-tests/testCustomIterator.cpp
+++ b/js/src/jsapi-tests/testCustomIterator.cpp
@@ -15,17 +15,17 @@ IterNext(JSContext *cx, unsigned argc, j
         return JS_ThrowStopIteration(cx);
     JS_SET_RVAL(cx, vp, INT_TO_JSVAL(count));
     return true;
 }
 
 static JSObject *
 IterHook(JSContext *cx, JS::HandleObject obj, JSBool keysonly)
 {
-    JS::RootedObject iterObj(cx, JS_NewObject(cx, NULL, NULL, NULL));
+    js::RootedObject iterObj(cx, JS_NewObject(cx, NULL, NULL, NULL));
     if (!iterObj)
         return NULL;
     if (!JS_DefineFunction(cx, iterObj, "next", IterNext, 0, 0))
         return NULL;
     return iterObj;
 }
 
 js::Class HasCustomIterClass = {
@@ -62,17 +62,17 @@ IterClassConstructor(JSContext *cx, unsi
     return true;
 }
 
 BEGIN_TEST(testCustomIterator_bug612523)
 {
     CHECK(JS_InitClass(cx, global, NULL, Jsvalify(&HasCustomIterClass),
                        IterClassConstructor, 0, NULL, NULL, NULL, NULL));
 
-    JS::RootedValue result(cx);
+    js::RootedValue result(cx);
     EVAL("var o = new HasCustomIter(); \n"
          "var j = 0; \n"
          "for (var i in o) { ++j; }; \n"
          "j;", result.address());
 
     CHECK(JSVAL_IS_INT(result));
     CHECK_EQUAL(JSVAL_TO_INT(result), 100);
     CHECK_EQUAL(count, 101);
--- a/js/src/jsapi-tests/testDebugger.cpp
+++ b/js/src/jsapi-tests/testDebugger.cpp
@@ -13,17 +13,17 @@
 static int callCount[2] = {0, 0};
 
 static void *
 callCountHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, JSBool before,
               JSBool *ok, void *closure)
 {
     callCount[before]++;
 
-    JS::RootedValue thisv(cx);
+    js::RootedValue thisv(cx);
     frame.getThisValue(cx, &thisv); // assert if fp is incomplete
 
     return cx;  // any non-null value causes the hook to be called again after
 }
 
 BEGIN_TEST(testDebugger_bug519719)
 {
     CHECK(JS_SetDebugMode(cx, JS_TRUE));
@@ -39,17 +39,17 @@ BEGIN_TEST(testDebugger_bug519719)
 END_TEST(testDebugger_bug519719)
 
 static void *
 nonStrictThisHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, JSBool before,
                   JSBool *ok, void *closure)
 {
     if (before) {
         bool *allWrapped = (bool *) closure;
-        JS::RootedValue thisv(cx);
+        js::RootedValue thisv(cx);
         frame.getThisValue(cx, &thisv);
         *allWrapped = *allWrapped && !JSVAL_IS_PRIMITIVE(thisv);
     }
     return NULL;
 }
 
 BEGIN_TEST(testDebugger_getThisNonStrict)
 {
@@ -78,17 +78,17 @@ BEGIN_TEST(testDebugger_getThisNonStrict
 END_TEST(testDebugger_getThisNonStrict)
 
 static void *
 strictThisHook(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, JSBool before,
                JSBool *ok, void *closure)
 {
     if (before) {
         bool *anyWrapped = (bool *) closure;
-        JS::RootedValue thisv(cx);
+        js::RootedValue thisv(cx);
         frame.getThisValue(cx, &thisv);
         *anyWrapped = *anyWrapped || !JSVAL_IS_PRIMITIVE(thisv);
     }
     return NULL;
 }
 
 BEGIN_TEST(testDebugger_getThisStrict)
 {
@@ -115,17 +115,17 @@ END_TEST(testDebugger_getThisStrict)
 bool called = false;
 
 static JSTrapStatus
 ThrowHook(JSContext *cx, JSScript *, jsbytecode *, jsval *rval, void *closure)
 {
     JS_ASSERT(!closure);
     called = true;
 
-    JS::RootedObject global(cx, JS_GetGlobalForScopeChain(cx));
+    js::RootedObject global(cx, JS_GetGlobalForScopeChain(cx));
 
     char text[] = "new Error()";
     jsval _;
     JS_EvaluateScript(cx, global, text, strlen(text), "", 0, &_);
 
     return JSTRAP_CONTINUE;
 }
 
@@ -148,28 +148,28 @@ BEGIN_TEST(testDebugger_throwHook)
     JS_SetOptions(cx, oldopts);
     return true;
 }
 END_TEST(testDebugger_throwHook)
 
 BEGIN_TEST(testDebugger_debuggerObjectVsDebugMode)
 {
     CHECK(JS_DefineDebuggerObject(cx, global));
-    JS::RootedObject debuggee(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
+    js::RootedObject debuggee(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
     CHECK(debuggee);
 
     {
         JSAutoCompartment ae(cx, debuggee);
         CHECK(JS_SetDebugMode(cx, true));
         CHECK(JS_InitStandardClasses(cx, debuggee));
     }
 
-    JS::RootedObject debuggeeWrapper(cx, debuggee);
+    js::RootedObject debuggeeWrapper(cx, debuggee);
     CHECK(JS_WrapObject(cx, debuggeeWrapper.address()));
-    JS::RootedValue v(cx, JS::ObjectValue(*debuggeeWrapper));
+    js::RootedValue v(cx, JS::ObjectValue(*debuggeeWrapper));
     CHECK(JS_SetProperty(cx, global, "debuggee", v.address()));
 
     EVAL("var dbg = new Debugger(debuggee);\n"
          "var hits = 0;\n"
          "dbg.onDebuggerStatement = function () { hits++; };\n"
          "debuggee.eval('debugger;');\n"
          "hits;\n",
          v.address());
@@ -188,26 +188,26 @@ BEGIN_TEST(testDebugger_debuggerObjectVs
     return true;
 }
 END_TEST(testDebugger_debuggerObjectVsDebugMode)
 
 BEGIN_TEST(testDebugger_newScriptHook)
 {
     // Test that top-level indirect eval fires the newScript hook.
     CHECK(JS_DefineDebuggerObject(cx, global));
-    JS::RootedObject g(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
+    js::RootedObject g(cx, JS_NewGlobalObject(cx, getGlobalClass(), NULL));
     CHECK(g);
     {
         JSAutoCompartment ae(cx, g);
         CHECK(JS_InitStandardClasses(cx, g));
     }
 
-    JS::RootedObject gWrapper(cx, g);
+    js::RootedObject gWrapper(cx, g);
     CHECK(JS_WrapObject(cx, gWrapper.address()));
-    JS::RootedValue v(cx, JS::ObjectValue(*gWrapper));
+    js::RootedValue v(cx, JS::ObjectValue(*gWrapper));
     CHECK(JS_SetProperty(cx, global, "g", v.address()));
 
     EXEC("var dbg = Debugger(g);\n"
          "var hits = 0;\n"
          "dbg.onNewScript = function (s) {\n"
          "    hits += Number(s instanceof Debugger.Script);\n"
          "};\n");
 
@@ -229,17 +229,17 @@ bool testIndirectEval(JS::HandleObject s
         JSString *codestr = JS_NewStringCopyZ(cx, code);
         CHECK(codestr);
         jsval argv[1] = { STRING_TO_JSVAL(codestr) };
         JS::AutoArrayRooter rooter(cx, 1, argv);
         jsval v;
         CHECK(JS_CallFunctionName(cx, scope, "eval", 1, argv, &v));
     }
 
-    JS::RootedValue hitsv(cx);
+    js::RootedValue hitsv(cx);
     EVAL("hits", hitsv.address());
     CHECK_SAME(hitsv, INT_TO_JSVAL(1));
     return true;
 }
 END_TEST(testDebugger_newScriptHook)
 
 BEGIN_TEST(testDebugger_singleStepThrow)
     {
--- a/js/src/jsapi-tests/testDeepFreeze.cpp
+++ b/js/src/jsapi-tests/testDeepFreeze.cpp
@@ -5,57 +5,57 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "tests.h"
 
 BEGIN_TEST(testDeepFreeze_bug535703)
 {
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     EVAL("var x = {}; x;", v.address());
-    JS::RootedObject obj(cx, JSVAL_TO_OBJECT(v));
+    js::RootedObject obj(cx, JSVAL_TO_OBJECT(v));
     CHECK(JS_DeepFreezeObject(cx, obj));  // don't crash
     EVAL("Object.isFrozen(x)", v.address());
     CHECK_SAME(v, JSVAL_TRUE);
     return true;
 }
 END_TEST(testDeepFreeze_bug535703)
 
 BEGIN_TEST(testDeepFreeze_deep)
 {
-    JS::RootedValue a(cx), o(cx);
+    js::RootedValue a(cx), o(cx);
     EXEC("var a = {}, o = a;\n"
          "for (var i = 0; i < 5000; i++)\n"
          "    a = {x: a, y: a};\n");
     EVAL("a", a.address());
     EVAL("o", o.address());
 
-    JS::RootedObject aobj(cx, JSVAL_TO_OBJECT(a));
+    js::RootedObject aobj(cx, JSVAL_TO_OBJECT(a));
     CHECK(JS_DeepFreezeObject(cx, aobj));
 
-    JS::RootedValue b(cx);
+    js::RootedValue b(cx);
     EVAL("Object.isFrozen(a)", b.address());
     CHECK_SAME(b, JSVAL_TRUE);
     EVAL("Object.isFrozen(o)", b.address());
     CHECK_SAME(b, JSVAL_TRUE);
     return true;
 }
 END_TEST(testDeepFreeze_deep)
 
 BEGIN_TEST(testDeepFreeze_loop)
 {
-    JS::RootedValue x(cx), y(cx);
+    js::RootedValue x(cx), y(cx);
     EXEC("var x = [], y = {x: x}; y.y = y; x.push(x, y);");
     EVAL("x", x.address());
     EVAL("y", y.address());
 
-    JS::RootedObject xobj(cx, JSVAL_TO_OBJECT(x));
+    js::RootedObject xobj(cx, JSVAL_TO_OBJECT(x));
     CHECK(JS_DeepFreezeObject(cx, xobj));
 
-    JS::RootedValue b(cx);
+    js::RootedValue b(cx);
     EVAL("Object.isFrozen(x)", b.address());
     CHECK_SAME(b, JSVAL_TRUE);
     EVAL("Object.isFrozen(y)", b.address());
     CHECK_SAME(b, JSVAL_TRUE);
     return true;
 }
 END_TEST(testDeepFreeze_loop)
--- a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp
+++ b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp
@@ -13,32 +13,32 @@ native(JSContext *cx, unsigned argc, jsv
 {
     return JS_TRUE;
 }
 
 static const char PROPERTY_NAME[] = "foo";
 
 BEGIN_TEST(testDefineGetterSetterNonEnumerable)
 {
-    JS::RootedValue vobj(cx);
-    JS::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
+    js::RootedValue vobj(cx);
+    js::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
     CHECK(obj);
     vobj = OBJECT_TO_JSVAL(obj);
 
     JSFunction *funGet = JS_NewFunction(cx, native, 0, 0, NULL, "get");
     CHECK(funGet);
-    JS::RootedObject funGetObj(cx, JS_GetFunctionObject(funGet));
-    JS::RootedValue vget(cx, OBJECT_TO_JSVAL(funGetObj));
+    js::RootedObject funGetObj(cx, JS_GetFunctionObject(funGet));
+    js::RootedValue vget(cx, OBJECT_TO_JSVAL(funGetObj));
 
     JSFunction *funSet = JS_NewFunction(cx, native, 1, 0, NULL, "set");
     CHECK(funSet);
-    JS::RootedObject funSetObj(cx, JS_GetFunctionObject(funSet));
-    JS::RootedValue vset(cx, OBJECT_TO_JSVAL(funSetObj));
+    js::RootedObject funSetObj(cx, JS_GetFunctionObject(funSet));
+    js::RootedValue vset(cx, OBJECT_TO_JSVAL(funSetObj));
 
-    JS::RootedObject vObject(cx, JSVAL_TO_OBJECT(vobj));
+    js::RootedObject vObject(cx, JSVAL_TO_OBJECT(vobj));
     CHECK(JS_DefineProperty(cx, vObject, PROPERTY_NAME,
                             JSVAL_VOID,
                             JS_DATA_TO_FUNC_PTR(JSPropertyOp, (JSObject*) funGetObj),
                             JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, (JSObject*) funSetObj),
                             JSPROP_GETTER | JSPROP_SETTER | JSPROP_ENUMERATE));
 
     CHECK(JS_DefineProperty(cx, vObject, PROPERTY_NAME,
                             JSVAL_VOID,
--- a/js/src/jsapi-tests/testDefineProperty.cpp
+++ b/js/src/jsapi-tests/testDefineProperty.cpp
@@ -5,20 +5,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "tests.h"
 
 BEGIN_TEST(testDefineProperty_bug564344)
 {
-    JS::RootedValue x(cx);
+    js::RootedValue x(cx);
     EVAL("function f() {}\n"
          "var x = {p: f};\n"
          "x.p();  // brand x's scope\n"
          "x;", x.address());
 
-    JS::RootedObject obj(cx, JSVAL_TO_OBJECT(x));
+    js::RootedObject obj(cx, JSVAL_TO_OBJECT(x));
     for (int i = 0; i < 2; i++)
         CHECK(JS_DefineProperty(cx, obj, "q", JSVAL_VOID, NULL, NULL, JSPROP_SHARED));
     return true;
 }
 END_TEST(testDefineProperty_bug564344)
--- a/js/src/jsapi-tests/testErrorCopying.cpp
+++ b/js/src/jsapi-tests/testErrorCopying.cpp
@@ -21,15 +21,15 @@ my_ErrorReporter(JSContext *cx, const ch
 }
 
 BEGIN_TEST(testErrorCopying_columnCopied)
 {
         //0         1         2
         //0123456789012345678901234567
     EXEC("function check() { Object; foo; }");
 
-    JS::RootedValue rval(cx);
+    js::RootedValue rval(cx);
     JS_SetErrorReporter(cx, my_ErrorReporter);
     CHECK(!JS_CallFunctionName(cx, global, "check", 0, NULL, rval.address()));
     CHECK(column == 27);
     return true;
 }
 END_TEST(testErrorCopying_columnCopied)
--- a/js/src/jsapi-tests/testFunctionProperties.cpp
+++ b/js/src/jsapi-tests/testFunctionProperties.cpp
@@ -5,22 +5,22 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "tests.h"
 
 BEGIN_TEST(testFunctionProperties)
 {
-    JS::RootedValue x(cx);
+    js::RootedValue x(cx);
     EVAL("(function f() {})", x.address());
 
-    JS::RootedObject obj(cx, JSVAL_TO_OBJECT(x));
+    js::RootedObject obj(cx, JSVAL_TO_OBJECT(x));
 
-    JS::RootedValue y(cx);
+    js::RootedValue y(cx);
     CHECK(JS_GetProperty(cx, obj, "arguments", y.address()));
     CHECK_SAME(y, JSVAL_NULL);
 
     CHECK(JS_GetProperty(cx, obj, "caller", y.address()));
     CHECK_SAME(y, JSVAL_NULL);
 
     return true;
 }
--- a/js/src/jsapi-tests/testGCFinalizeCallback.cpp
+++ b/js/src/jsapi-tests/testGCFinalizeCallback.cpp
@@ -42,19 +42,19 @@ BEGIN_TEST(testGCFinalizeCallback)
     js::PrepareForFullGC(rt);
     js::IncrementalGC(rt, js::gcreason::API, 1000000);
     CHECK(rt->gcIncrementalState == js::gc::NO_INCREMENTAL);
     CHECK(rt->gcIsFull);
     CHECK(checkMultipleGroups());
     CHECK(checkFinalizeStatus());
     CHECK(checkFinalizeIsCompartmentGC(false));
 
-    JS::RootedObject global1(cx, createGlobal());
-    JS::RootedObject global2(cx, createGlobal());
-    JS::RootedObject global3(cx, createGlobal());
+    js::RootedObject global1(cx, createGlobal());
+    js::RootedObject global2(cx, createGlobal());
+    js::RootedObject global3(cx, createGlobal());
     CHECK(global1);
     CHECK(global2);
     CHECK(global3);
 
     /* Compartment GC, non-incremental, single compartment. */
     FinalizeCalls = 0;
     js::PrepareZoneForGC(global1->zone());
     js::GCForReason(rt, js::gcreason::API);
@@ -102,17 +102,17 @@ BEGIN_TEST(testGCFinalizeCallback)
 
     FinalizeCalls = 0;
     JS_SetGCZeal(cx, 9, 1000000);
     js::PrepareForFullGC(rt);
     js::GCDebugSlice(rt, true, 1);
     CHECK(rt->gcIncrementalState == js::gc::MARK);
     CHECK(rt->gcIsFull);
 
-    JS::RootedObject global4(cx, createGlobal());
+    js::RootedObject global4(cx, createGlobal());
     js::GCDebugSlice(rt, true, 1);
     CHECK(rt->gcIncrementalState == js::gc::NO_INCREMENTAL);
     CHECK(!rt->gcIsFull);
     CHECK(checkMultipleGroups());
     CHECK(checkFinalizeStatus());
 
     for (unsigned i = 0; i < FinalizeCalls - 1; ++i)
         CHECK(!IsCompartmentGCBuffer[i]);
--- a/js/src/jsapi-tests/testGCOutOfMemory.cpp
+++ b/js/src/jsapi-tests/testGCOutOfMemory.cpp
@@ -16,17 +16,17 @@ ErrorCounter(JSContext *cx, const char *
 {
     ++errorCount;
 }
 
 BEGIN_TEST(testGCOutOfMemory)
 {
     JS_SetErrorReporter(cx, ErrorCounter);
 
-    JS::RootedValue root(cx);
+    js::RootedValue root(cx);
 
     static const char source[] =
         "var max = 0; (function() {"
         "    var array = [];"
         "    for (; ; ++max)"
         "        array.push({});"
         "    array = []; array.push(0);"
         "})();";
--- a/js/src/jsapi-tests/testGetPropertyDefault.cpp
+++ b/js/src/jsapi-tests/testGetPropertyDefault.cpp
@@ -21,50 +21,50 @@ stringToId(JSContext *cx, const char *s,
     return JS_ValueToId(cx, STRING_TO_JSVAL(str), idp);
 }
 
 BEGIN_TEST(testGetPropertyDefault_bug594060)
 {
     {
         // Check JS_GetPropertyDefault
 
-        JS::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
+        js::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
         CHECK(obj);
 
-        JS::RootedValue v0(cx, JSVAL_TRUE);
+        js::RootedValue v0(cx, JSVAL_TRUE);
         CHECK(JS_SetProperty(cx, obj, "here", v0.address()));
 
-        JS::RootedValue v1(cx);
+        js::RootedValue v1(cx);
         CHECK(JS_GetPropertyDefault(cx, obj, "here", JSVAL_FALSE, v1.address()));
         CHECK(JSVAL_IS_TRUE(v1));
 
-        JS::RootedValue v2(cx);
+        js::RootedValue v2(cx);
         CHECK(JS_GetPropertyDefault(cx, obj, "nothere", JSVAL_FALSE, v2.address()));
         CHECK(JSVAL_IS_FALSE(v2));
     }
 
     {
         // Check JS_GetPropertyByIdDefault
 
-        JS::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
+        js::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
         CHECK(obj);
 
         jsid hereid;
         CHECK(stringToId(cx, "here", &hereid));
 
         jsid nothereid;
         CHECK(stringToId(cx, "nothere", &nothereid));
 
-        JS::RootedValue v0(cx, JSVAL_TRUE);
+        js::RootedValue v0(cx, JSVAL_TRUE);
         CHECK(JS_SetPropertyById(cx, obj, hereid, v0.address()));
 
-        JS::RootedValue v1(cx);
+        js::RootedValue v1(cx);
         CHECK(JS_GetPropertyByIdDefault(cx, obj, hereid, JSVAL_FALSE, v1.address()));
         CHECK(JSVAL_IS_TRUE(v1));
 
-        JS::RootedValue v2(cx);
+        js::RootedValue v2(cx);
         CHECK(JS_GetPropertyByIdDefault(cx, obj, nothereid, JSVAL_FALSE, v2.address()));
         CHECK(JSVAL_IS_FALSE(v2));
     }
 
     return true;
 }
 END_TEST(testGetPropertyDefault_bug594060)
--- a/js/src/jsapi-tests/testIntString.cpp
+++ b/js/src/jsapi-tests/testIntString.cpp
@@ -6,17 +6,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "tests.h"
 #include "vm/String.h"
 
 BEGIN_TEST(testIntString_bug515273)
 {
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
 
     EVAL("'1';", v.address());
     JSString *str = JSVAL_TO_STRING(v);
     CHECK(JS_StringHasBeenInterned(cx, str));
     CHECK(JS_FlatStringEqualsAscii(JS_ASSERT_STRING_IS_FLAT(str), "1"));
 
     EVAL("'42';", v.address());
     str = JSVAL_TO_STRING(v);
--- a/js/src/jsapi-tests/testIntern.cpp
+++ b/js/src/jsapi-tests/testIntern.cpp
@@ -8,17 +8,17 @@
 #include "vm/String.h"
 
 using mozilla::ArrayLength;
 
 BEGIN_TEST(testAtomizedIsNotInterned)
 {
     /* Try to pick a string that won't be interned by other tests in this runtime. */
     static const char someChars[] = "blah blah blah? blah blah blah";
-    JS::Rooted<JSAtom*> atom(cx, js::Atomize(cx, someChars, ArrayLength(someChars)));
+    js::Rooted<JSAtom*> atom(cx, js::Atomize(cx, someChars, ArrayLength(someChars)));
     CHECK(!JS_StringHasBeenInterned(cx, atom));
     CHECK(JS_InternJSString(cx, atom));
     CHECK(JS_StringHasBeenInterned(cx, atom));
     return true;
 }
 END_TEST(testAtomizedIsNotInterned)
 
 struct StringWrapper
--- a/js/src/jsapi-tests/testJSEvaluateScript.cpp
+++ b/js/src/jsapi-tests/testJSEvaluateScript.cpp
@@ -1,25 +1,25 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sw=4 et tw=99:
  */
 
 #include "tests.h"
 
 BEGIN_TEST(testJSEvaluateScript)
 {
-    JS::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, global));
+    js::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, global));
     CHECK(obj);
 
     uint32_t options = JS_GetOptions(cx);
     CHECK(options & JSOPTION_VAROBJFIX);
 
     static const char src[] = "var x = 5;";
 
-    JS::RootedValue retval(cx);
+    js::RootedValue retval(cx);
     CHECK(JS_EvaluateScript(cx, obj, src, sizeof(src) - 1, __FILE__, __LINE__,
                             retval.address()));
 
     JSBool hasProp = JS_TRUE;
     CHECK(JS_AlreadyHasOwnProperty(cx, obj, "x", &hasProp));
     CHECK(!hasProp);
 
     hasProp = JS_FALSE;
--- a/js/src/jsapi-tests/testLookup.cpp
+++ b/js/src/jsapi-tests/testLookup.cpp
@@ -9,29 +9,29 @@
 #include "tests.h"
 #include "jsfun.h"  // for js::IsInternalFunctionObject
 
 #include "jsobjinlines.h"
 
 BEGIN_TEST(testLookup_bug522590)
 {
     // Define a function that makes method-bearing objects.
-    JS::RootedValue x(cx);
+    js::RootedValue x(cx);
     EXEC("function mkobj() { return {f: function () {return 2;}} }");
 
     // Calling mkobj() multiple times must create multiple functions in ES5.
     EVAL("mkobj().f !== mkobj().f", x.address());
     CHECK_SAME(x, JSVAL_TRUE);
 
     // Now make x.f a method.
     EVAL("mkobj()", x.address());
-    JS::RootedObject xobj(cx, JSVAL_TO_OBJECT(x));
+    js::RootedObject xobj(cx, JSVAL_TO_OBJECT(x));
 
     // This lookup must not return an internal function object.
-    JS::RootedValue r(cx);
+    js::RootedValue r(cx);
     CHECK(JS_LookupProperty(cx, xobj, "f", r.address()));
     CHECK(r.isObject());
     JSObject *funobj = &r.toObject();
     CHECK(funobj->isFunction());
     CHECK(!js::IsInternalFunctionObject(funobj));
 
     return true;
 }
@@ -49,29 +49,29 @@ static JSClass DocumentAllClass = {
     JS_ConvertStub
 };
 
 JSBool
 document_resolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
                  JSMutableHandleObject objp)
 {
     // If id is "all", resolve document.all=true.
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     if (!JS_IdToValue(cx, id, v.address()))
         return false;
     if (JSVAL_IS_STRING(v)) {
         JSString *str = JSVAL_TO_STRING(v);
         JSFlatString *flatStr = JS_FlattenString(cx, str);
         if (!flatStr)
             return false;
         if (JS_FlatStringEqualsAscii(flatStr, "all")) {
-            JS::Rooted<JSObject*> docAll(cx, JS_NewObject(cx, &DocumentAllClass, NULL, NULL));
+            js::Rooted<JSObject*> docAll(cx, JS_NewObject(cx, &DocumentAllClass, NULL, NULL));
             if (!docAll)
                 return false;
-            JS::Rooted<JS::Value> allValue(cx, ObjectValue(*docAll));
+            js::Rooted<JS::Value> allValue(cx, ObjectValue(*docAll));
             JSBool ok = JS_DefinePropertyById(cx, obj, id, allValue, NULL, NULL, 0);
             objp.set(ok ? obj.get() : NULL);
             return ok;
         }
     }
     objp.set(NULL);
     return true;
 }
@@ -79,19 +79,19 @@ document_resolve(JSContext *cx, JSHandle
 static JSClass document_class = {
     "document", JSCLASS_NEW_RESOLVE,
     JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
     JS_EnumerateStub, (JSResolveOp) document_resolve, JS_ConvertStub
 };
 
 BEGIN_TEST(testLookup_bug570195)
 {
-    JS::RootedObject obj(cx, JS_NewObject(cx, &document_class, NULL, NULL));
+    js::RootedObject obj(cx, JS_NewObject(cx, &document_class, NULL, NULL));
     CHECK(obj);
     CHECK(JS_DefineProperty(cx, global, "document", OBJECT_TO_JSVAL(obj), NULL, NULL, 0));
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     EVAL("document.all ? true : false", v.address());
     CHECK_SAME(v, JSVAL_FALSE);
     EVAL("document.hasOwnProperty('all')", v.address());
     CHECK_SAME(v, JSVAL_TRUE);
     return true;
 }
 END_TEST(testLookup_bug570195)
--- a/js/src/jsapi-tests/testLooselyEqual.cpp
+++ b/js/src/jsapi-tests/testLooselyEqual.cpp
@@ -24,25 +24,25 @@ struct LooseEqualityFixture : public JSA
         CHECK(JS_LooselyEqual(cx, x, y, &equal) && !equal);
         CHECK(JS_LooselyEqual(cx, y, x, &equal) && !equal);
         return true;
     }
 };
 
 struct LooseEqualityData
 {
-    JS::RootedValue qNaN;
-    JS::RootedValue sNaN;
-    JS::RootedValue d42;
-    JS::RootedValue i42;
-    JS::RootedValue undef;
-    JS::RootedValue null;
-    JS::RootedValue obj;
-    JS::RootedValue poszero;
-    JS::RootedValue negzero;
+    js::RootedValue qNaN;
+    js::RootedValue sNaN;
+    js::RootedValue d42;
+    js::RootedValue i42;
+    js::RootedValue undef;
+    js::RootedValue null;
+    js::RootedValue obj;
+    js::RootedValue poszero;
+    js::RootedValue negzero;
 
     LooseEqualityData(JSContext *cx)
       : qNaN(cx),
         sNaN(cx),
         d42(cx),
         i42(cx),
         undef(cx),
         null(cx),
--- a/js/src/jsapi-tests/testNewObject.cpp
+++ b/js/src/jsapi-tests/testNewObject.cpp
@@ -12,19 +12,19 @@
 
 const size_t N = 1000;
 static jsval argv[N];
 
 static JSBool
 constructHook(JSContext *cx, unsigned argc, jsval *vp)
 {
     // Check that arguments were passed properly from JS_New.
-    JS::RootedObject callee(cx, JSVAL_TO_OBJECT(JS_CALLEE(cx, vp)));
+    js::RootedObject callee(cx, JSVAL_TO_OBJECT(JS_CALLEE(cx, vp)));
 
-    JS::RootedObject obj(cx, JS_NewObjectForConstructor(cx, js::Jsvalify(&js::ObjectClass), vp));
+    js::RootedObject obj(cx, JS_NewObjectForConstructor(cx, js::Jsvalify(&js::ObjectClass), vp));
     if (!obj) {
         JS_ReportError(cx, "test failed, could not construct object");
         return false;
     }
     if (strcmp(JS_GetClass(obj)->name, "Object") != 0) {
         JS_ReportError(cx, "test failed, wrong class for 'this'");
         return false;
     }
@@ -52,24 +52,24 @@ constructHook(JSContext *cx, unsigned ar
 
 BEGIN_TEST(testNewObject_1)
 {
     // Root the global argv test array. Only the first 2 entries really need to
     // be rooted, since we're only putting integers in the rest.
     CHECK(JS_AddNamedValueRoot(cx, &argv[0], "argv0"));
     CHECK(JS_AddNamedValueRoot(cx, &argv[1], "argv1"));
 
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     EVAL("Array", v.address());
-    JS::RootedObject Array(cx, JSVAL_TO_OBJECT(v));
+    js::RootedObject Array(cx, JSVAL_TO_OBJECT(v));
 
     // With no arguments.
-    JS::RootedObject obj(cx, JS_New(cx, Array, 0, NULL));
+    js::RootedObject obj(cx, JS_New(cx, Array, 0, NULL));
     CHECK(obj);
-    JS::RootedValue rt(cx, OBJECT_TO_JSVAL(obj));
+    js::RootedValue rt(cx, OBJECT_TO_JSVAL(obj));
     CHECK(JS_IsArrayObject(cx, obj));
     uint32_t len;
     CHECK(JS_GetArrayLength(cx, obj, &len));
     CHECK_EQUAL(len, 0);
 
     // With one argument.
     argv[0] = INT_TO_JSVAL(4);
     obj = JS_New(cx, Array, 1, argv);
@@ -94,19 +94,19 @@ BEGIN_TEST(testNewObject_1)
     // With JSClass.construct.
     static JSClass cls = {
         "testNewObject_1",
         0,
         JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
         JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL,
         NULL, NULL, NULL, constructHook
     };
-    JS::RootedObject ctor(cx, JS_NewObject(cx, &cls, NULL, NULL));
+    js::RootedObject ctor(cx, JS_NewObject(cx, &cls, NULL, NULL));
     CHECK(ctor);
-    JS::RootedValue rt2(cx, OBJECT_TO_JSVAL(ctor));
+    js::RootedValue rt2(cx, OBJECT_TO_JSVAL(ctor));
     obj = JS_New(cx, ctor, 3, argv);
     CHECK(obj);
     CHECK(JS_GetElement(cx, ctor, 0, v.address()));
     CHECK_SAME(v, JSVAL_ZERO);
 
     JS_RemoveValueRoot(cx, &argv[0]);
     JS_RemoveValueRoot(cx, &argv[1]);
 
--- a/js/src/jsapi-tests/testOOM.cpp
+++ b/js/src/jsapi-tests/testOOM.cpp
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "tests.h"
 
 #include "mozilla/DebugOnly.h"
 
 BEGIN_TEST(testOOM)
 {
-    JS::RootedString jsstr(cx, JS_ValueToString(cx, INT_TO_JSVAL(9)));
+    js::RootedString jsstr(cx, JS_ValueToString(cx, INT_TO_JSVAL(9)));
     mozilla::DebugOnly<const jschar *> s = JS_GetStringCharsZ(cx, jsstr);
     JS_ASSERT(s[0] == '9' && s[1] == '\0');
     return true;
 }
 
 virtual JSRuntime * createRuntime()
 {
     JSRuntime *rt = JS_NewRuntime(0, JS_USE_HELPER_THREADS);
--- a/js/src/jsapi-tests/testObjectEmulatingUndefined.cpp
+++ b/js/src/jsapi-tests/testObjectEmulatingUndefined.cpp
@@ -26,17 +26,17 @@ ObjectEmulatingUndefinedConstructor(JSCo
     return true;
 }
 
 BEGIN_TEST(testObjectEmulatingUndefined_truthy)
 {
     CHECK(JS_InitClass(cx, global, NULL, &ObjectEmulatingUndefinedClass,
                        ObjectEmulatingUndefinedConstructor, 0, NULL, NULL, NULL, NULL));
 
-    JS::RootedValue result(cx);
+    js::RootedValue result(cx);
 
     EVAL("if (new ObjectEmulatingUndefined()) true; else false;", result.address());
     CHECK_SAME(result, JSVAL_FALSE);
 
     EVAL("if (!new ObjectEmulatingUndefined()) true; else false;", result.address());
     CHECK_SAME(result, JSVAL_TRUE);
 
     EVAL("var obj = new ObjectEmulatingUndefined(); \n"
@@ -51,17 +51,17 @@ BEGIN_TEST(testObjectEmulatingUndefined_
 }
 END_TEST(testObjectEmulatingUndefined_truthy)
 
 BEGIN_TEST(testObjectEmulatingUndefined_equal)
 {
     CHECK(JS_InitClass(cx, global, NULL, &ObjectEmulatingUndefinedClass,
                        ObjectEmulatingUndefinedConstructor, 0, NULL, NULL, NULL, NULL));
 
-    JS::RootedValue result(cx);
+    js::RootedValue result(cx);
 
     EVAL("if (new ObjectEmulatingUndefined() == undefined) true; else false;", result.address());
     CHECK_SAME(result, JSVAL_TRUE);
 
     EVAL("if (new ObjectEmulatingUndefined() == null) true; else false;", result.address());
     CHECK_SAME(result, JSVAL_TRUE);
 
     EVAL("if (new ObjectEmulatingUndefined() != undefined) true; else false;", result.address());
--- a/js/src/jsapi-tests/testOps.cpp
+++ b/js/src/jsapi-tests/testOps.cpp
@@ -50,16 +50,16 @@ static JSFunctionSpec s_functions[] =
 
 BEGIN_TEST(testOps_bug559006)
 {
     CHECK(JS_DefineFunctions(cx, global, s_functions));
 
     EXEC("function main() { while(1) return 0 + createMyObject(); }");
 
     for (int i = 0; i < 9; i++) {
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         CHECK(JS_CallFunctionName(cx, global, "main", 0, NULL, rval.address()));
         CHECK_SAME(rval, INT_TO_JSVAL(123));
     }
     return true;
 }
 END_TEST(testOps_bug559006)
 
--- a/js/src/jsapi-tests/testOriginPrincipals.cpp
+++ b/js/src/jsapi-tests/testOriginPrincipals.cpp
@@ -56,17 +56,17 @@ bool
 eval(const char *asciiChars, JSPrincipals *principals, JSPrincipals *originPrincipals, jsval *rval)
 {
     size_t len = strlen(asciiChars);
     jschar *chars = new jschar[len+1];
     for (size_t i = 0; i < len; ++i)
         chars[i] = asciiChars[i];
     chars[len] = 0;
 
-    JS::RootedObject global(cx, JS_NewGlobalObject(cx, getGlobalClass(), principals));
+    js::RootedObject global(cx, JS_NewGlobalObject(cx, getGlobalClass(), principals));
     CHECK(global);
     JSAutoCompartment ac(cx, global);
     CHECK(JS_InitStandardClasses(cx, global));
     bool ok = JS_EvaluateUCScriptForPrincipalsVersionOrigin(cx, global,
                                                             principals,
                                                             originPrincipals,
                                                             chars, len, "", 0, rval,
                                                             JSVERSION_DEFAULT);
@@ -80,17 +80,17 @@ testOuter(const char *asciiChars)
     CHECK(testInner(asciiChars, &prin1, &prin1));
     CHECK(testInner(asciiChars, &prin1, &prin2));
     return true;
 }
 
 bool
 testInner(const char *asciiChars, JSPrincipals *principal, JSPrincipals *originPrincipal)
 {
-    JS::RootedValue rval(cx);
+    js::RootedValue rval(cx);
     CHECK(eval(asciiChars, principal, originPrincipal, rval.address()));
 
     JSScript *script = JS_GetFunctionScript(cx, JSVAL_TO_OBJECT(rval)->toFunction());
     CHECK(JS_GetScriptPrincipals(script) == principal);
     CHECK(JS_GetScriptOriginPrincipals(script) == originPrincipal);
 
     return true;
 }
--- a/js/src/jsapi-tests/testParseJSON.cpp
+++ b/js/src/jsapi-tests/testParseJSON.cpp
@@ -52,17 +52,17 @@ BEGIN_TEST(testParseJSON_success)
     CHECK(TryParse(cx, "0", INT_TO_JSVAL(0)));
     CHECK(TryParse(cx, "1", INT_TO_JSVAL(1)));
     CHECK(TryParse(cx, "-1", INT_TO_JSVAL(-1)));
     CHECK(TryParse(cx, "1", DOUBLE_TO_JSVAL(1)));
     CHECK(TryParse(cx, "1.75", DOUBLE_TO_JSVAL(1.75)));
     CHECK(TryParse(cx, "9e9", DOUBLE_TO_JSVAL(9e9)));
     CHECK(TryParse(cx, "9e99999", DOUBLE_TO_JSVAL(std::numeric_limits<double>::infinity())));
 
-    JS::Rooted<JSFlatString*> str(cx);
+    js::Rooted<JSFlatString*> str(cx);
 
     const jschar emptystr[] = { '\0' };
     str = js_NewStringCopyN<CanGC>(cx, emptystr, 0);
     CHECK(str);
     CHECK(TryParse(cx, "\"\"", STRING_TO_JSVAL(str)));
 
     const jschar nullstr[] = { '\0' };
     str = NewString(cx, nullstr);
@@ -78,18 +78,18 @@ BEGIN_TEST(testParseJSON_success)
     const jschar newlinestr[] = { '\n', };
     str = NewString(cx, newlinestr);
     CHECK(str);
     CHECK(TryParse(cx, "\"\\n\"", STRING_TO_JSVAL(str)));
     CHECK(TryParse(cx, "\"\\u000A\"", STRING_TO_JSVAL(str)));
 
 
     // Arrays
-    JS::RootedValue v(cx), v2(cx);
-    JS::RootedObject obj(cx);
+    js::RootedValue v(cx), v2(cx);
+    js::RootedObject obj(cx);
 
     CHECK(Parse(cx, "[]", v.address()));
     CHECK(!JSVAL_IS_PRIMITIVE(v));
     obj = JSVAL_TO_OBJECT(v);
     CHECK(JS_IsArrayObject(cx, obj));
     CHECK(JS_GetProperty(cx, obj, "length", v2.address()));
     CHECK_SAME(v2, JSVAL_ZERO);
 
@@ -127,17 +127,17 @@ Parse(JSContext *cx, const char (&input)
     CHECK(JS_ParseJSON(cx, str.chars(), str.length(), vp));
     return true;
 }
 
 template<size_t N> inline bool
 TryParse(JSContext *cx, const char (&input)[N], const jsval &expectedArg)
 {
     AutoInflatedString str(cx);
-    JS::RootedValue expected(cx, expectedArg);
+    js::RootedValue expected(cx, expectedArg);
     RootedValue v(cx);
     str = input;
     CHECK(JS_ParseJSON(cx, str.chars(), str.length(), v.address()));
     CHECK_SAME(v, expected);
     return true;
 }
 END_TEST(testParseJSON_success)
 
@@ -210,32 +210,32 @@ Censor(JSContext *cx, unsigned argc, jsv
     return true;
 }
 
 BEGIN_TEST(testParseJSON_reviver)
 {
     JSFunction *fun = JS_NewFunction(cx, Censor, 0, 0, global, "censor");
     CHECK(fun);
 
-    JS::RootedValue filter(cx, OBJECT_TO_JSVAL(JS_GetFunctionObject(fun)));
+    js::RootedValue filter(cx, OBJECT_TO_JSVAL(JS_GetFunctionObject(fun)));
 
     CHECK(TryParse(cx, "true", filter));
     CHECK(TryParse(cx, "false", filter));
     CHECK(TryParse(cx, "null", filter));
     CHECK(TryParse(cx, "1", filter));
     CHECK(TryParse(cx, "1.75", filter));
     CHECK(TryParse(cx, "[]", filter));
     CHECK(TryParse(cx, "[1]", filter));
     CHECK(TryParse(cx, "{}", filter));
     return true;
 }
 
 template<size_t N> inline bool
 TryParse(JSContext *cx, const char (&input)[N], JS::HandleValue filter)
 {
     AutoInflatedString str(cx);
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     str = input;
     CHECK(JS_ParseJSONWithReviver(cx, str.chars(), str.length(), filter, v.address()));
     CHECK_SAME(v, JSVAL_NULL);
     return true;
 }
 END_TEST(testParseJSON_reviver)
--- a/js/src/jsapi-tests/testProfileStrings.cpp
+++ b/js/src/jsapi-tests/testProfileStrings.cpp
@@ -37,17 +37,17 @@ test_fn(JSContext *cx, unsigned argc, js
     max_stack = psize;
     return JS_TRUE;
 }
 
 static JSBool
 test_fn2(JSContext *cx, unsigned argc, jsval *vp)
 {
     jsval r;
-    JS::RootedObject global(cx, JS_GetGlobalObject(cx));
+    js::RootedObject global(cx, JS_GetGlobalObject(cx));
     return JS_CallFunctionName(cx, global, "d", 0, NULL, &r);
 }
 
 static JSBool
 enable(JSContext *cx, unsigned argc, jsval *vp)
 {
     js::EnableRuntimeProfilingStack(cx->runtime, true);
     return JS_TRUE;
@@ -77,17 +77,17 @@ static JSFunctionSpec ptestFunctions[] =
     JS_FS("disable", disable, 0, 0),
     JS_FS_END
 };
 
 static JSObject*
 initialize(JSContext *cx)
 {
     js::SetRuntimeProfilingStack(cx->runtime, pstack, &psize, 10);
-    JS::RootedObject global(cx, JS_GetGlobalObject(cx));
+    js::RootedObject global(cx, JS_GetGlobalObject(cx));
     return JS_InitClass(cx, global, NULL, &ptestClass, Prof, 0,
                         NULL, ptestFunctions, NULL, NULL);
 }
 
 BEGIN_TEST(testProfileStrings_isCalledWithInterpreter)
 {
     CHECK(initialize(cx));
 
@@ -98,42 +98,42 @@ BEGIN_TEST(testProfileStrings_isCalledWi
     EXEC("function c() { d(); }");
     EXEC("function b() { c(); }");
     EXEC("function a() { b(); }");
     EXEC("function check() { var p = new Prof(); p.test_fn(); a(); }");
     EXEC("function check2() { var p = new Prof(); p.test_fn2(); }");
 
     reset(cx);
     {
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         /* Make sure the stack resets and we have an entry for each stack */
         CHECK(JS_CallFunctionName(cx, global, "check", 0, NULL, rval.address()));
         CHECK(psize == 0);
         CHECK(max_stack >= 8);
         CHECK(cx->runtime->spsProfiler.stringsCount() == 8);
         /* Make sure the stack resets and we added no new entries */
         max_stack = 0;
         CHECK(JS_CallFunctionName(cx, global, "check", 0, NULL, rval.address()));
         CHECK(psize == 0);
         CHECK(max_stack >= 8);
         CHECK(cx->runtime->spsProfiler.stringsCount() == 8);
     }
     reset(cx);
     {
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         CHECK(JS_CallFunctionName(cx, global, "check2", 0, NULL, rval.address()));
         CHECK(cx->runtime->spsProfiler.stringsCount() == 5);
         CHECK(max_stack >= 6);
         CHECK(psize == 0);
     }
     js::EnableRuntimeProfilingStack(cx->runtime, false);
     js::SetRuntimeProfilingStack(cx->runtime, pstack, &psize, 3);
     reset(cx);
     {
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         pstack[3].setLabel((char*) 1234);
         CHECK(JS_CallFunctionName(cx, global, "check", 0, NULL, rval.address()));
         CHECK((size_t) pstack[3].label() == 1234);
         CHECK(max_stack >= 8);
         CHECK(psize == 0);
     }
     return true;
 }
@@ -152,17 +152,17 @@ BEGIN_TEST(testProfileStrings_isCalledWi
     EXEC("function c() { d(); }");
     EXEC("function b() { c(); }");
     EXEC("function a() { b(); }");
     EXEC("function check() { var p = new Prof(); p.test_fn(); a(); }");
     EXEC("function check2() { var p = new Prof(); p.test_fn2(); }");
 
     reset(cx);
     {
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         /* Make sure the stack resets and we have an entry for each stack */
         CHECK(JS_CallFunctionName(cx, global, "check", 0, NULL, rval.address()));
         CHECK(psize == 0);
         CHECK(max_stack >= 8);
 
         /* Make sure the stack resets and we added no new entries */
         uint32_t cnt = cx->runtime->spsProfiler.stringsCount();
         max_stack = 0;
@@ -172,17 +172,17 @@ BEGIN_TEST(testProfileStrings_isCalledWi
         CHECK(max_stack >= 8);
     }
 
     js::EnableRuntimeProfilingStack(cx->runtime, false);
     js::SetRuntimeProfilingStack(cx->runtime, pstack, &psize, 3);
     reset(cx);
     {
         /* Limit the size of the stack and make sure we don't overflow */
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         pstack[3].setLabel((char*) 1234);
         CHECK(JS_CallFunctionName(cx, global, "check", 0, NULL, rval.address()));
         CHECK(psize == 0);
         CHECK(max_stack >= 8);
         CHECK((size_t) pstack[3].label() == 1234);
     }
     return true;
 }
@@ -193,17 +193,17 @@ BEGIN_TEST(testProfileStrings_isCalledWh
     CHECK(initialize(cx));
     JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_METHODJIT | JSOPTION_METHODJIT_ALWAYS);
 
     EXEC("function check2() { throw 'a'; }");
 
     reset(cx);
     JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_DONT_REPORT_UNCAUGHT);
     {
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         /* Make sure the stack resets and we have an entry for each stack */
         JSBool ok = JS_CallFunctionName(cx, global, "check2", 0, NULL, rval.address());
         CHECK(!ok);
         CHECK(psize == 0);
         CHECK(cx->runtime->spsProfiler.stringsCount() == 1);
 
         JS_ClearPendingException(cx);
     }
@@ -217,50 +217,50 @@ BEGIN_TEST(testProfileStrings_worksWhenE
     JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_METHODJIT | JSOPTION_METHODJIT_ALWAYS);
 
     EXEC("function b(p) { p.test_fn(); }");
     EXEC("function a() { var p = new Prof(); p.enable(); b(p); }");
     reset(cx);
     js::EnableRuntimeProfilingStack(cx->runtime, false);
     {
         /* enable it in the middle of JS and make sure things check out */
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         JS_CallFunctionName(cx, global, "a", 0, NULL, rval.address());
         CHECK(psize == 0);
         CHECK(max_stack >= 1);
         CHECK(cx->runtime->spsProfiler.stringsCount() == 1);
     }
 
     EXEC("function d(p) { p.disable(); }");
     EXEC("function c() { var p = new Prof(); d(p); }");
     reset(cx);
     {
         /* now disable in the middle of js */
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         JS_CallFunctionName(cx, global, "c", 0, NULL, rval.address());
         CHECK(psize == 0);
     }
 
     EXEC("function e() { var p = new Prof(); d(p); p.enable(); b(p); }");
     reset(cx);
     {
         /* now disable in the middle of js, but re-enable before final exit */
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         JS_CallFunctionName(cx, global, "e", 0, NULL, rval.address());
         CHECK(psize == 0);
         CHECK(max_stack >= 3);
     }
 
     EXEC("function h() { }");
     EXEC("function g(p) { p.disable(); for (var i = 0; i < 100; i++) i++; }");
     EXEC("function f() { g(new Prof()); }");
     reset(cx);
     cx->runtime->spsProfiler.enableSlowAssertions(false);
     {
-        JS::RootedValue rval(cx);
+        js::RootedValue rval(cx);
         /* disable, and make sure that if we try to re-enter the JIT the pop
          * will still happen */
         JS_CallFunctionName(cx, global, "f", 0, NULL, rval.address());
         CHECK(psize == 0);
     }
     return true;
 }
 END_TEST(testProfileStrings_worksWhenEnabledOnTheFly)
--- a/js/src/jsapi-tests/testRegExp.cpp
+++ b/js/src/jsapi-tests/testRegExp.cpp
@@ -1,34 +1,34 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "tests.h"
 
 BEGIN_TEST(testObjectIsRegExp)
 {
-    JS::RootedValue val(cx);
+    js::RootedValue val(cx);
 
     EVAL("new Object", val.address());
-    JS::RootedObject obj(cx, JSVAL_TO_OBJECT(val));
+    js::RootedObject obj(cx, JSVAL_TO_OBJECT(val));
     CHECK(!JS_ObjectIsRegExp(cx, obj));
 
     EVAL("/foopy/", val.address());
     obj = JSVAL_TO_OBJECT(val);
     CHECK(JS_ObjectIsRegExp(cx, obj));
 
     return true;
 }
 END_TEST(testObjectIsRegExp)
 
 BEGIN_TEST(testGetRegExpFlags)
 {
-    JS::RootedValue val(cx);
-    JS::RootedObject obj(cx);
+    js::RootedValue val(cx);
+    js::RootedObject obj(cx);
 
     EVAL("/foopy/", val.address());
     obj = JSVAL_TO_OBJECT(val);
     CHECK_EQUAL(JS_GetRegExpFlags(cx, obj), 0);
 
     EVAL("/foopy/g", val.address());
     obj = JSVAL_TO_OBJECT(val);
     CHECK_EQUAL(JS_GetRegExpFlags(cx, obj), JSREG_GLOB);
@@ -38,18 +38,18 @@ BEGIN_TEST(testGetRegExpFlags)
     CHECK_EQUAL(JS_GetRegExpFlags(cx, obj), (JSREG_FOLD | JSREG_GLOB));
 
     return true;
 }
 END_TEST(testGetRegExpFlags)
 
 BEGIN_TEST(testGetRegExpSource)
 {
-    JS::RootedValue val(cx);
-    JS::RootedObject obj(cx);
+    js::RootedValue val(cx);
+    js::RootedObject obj(cx);
 
     EVAL("/foopy/", val.address());
     obj = JSVAL_TO_OBJECT(val);
     JSString *source = JS_GetRegExpSource(cx, obj);
     CHECK(JS_FlatStringEqualsAscii(JS_ASSERT_STRING_IS_FLAT(source), "foopy"));
 
     return true;
 }
--- a/js/src/jsapi-tests/testResolveRecursion.cpp
+++ b/js/src/jsapi-tests/testResolveRecursion.cpp
@@ -37,17 +37,17 @@ BEGIN_TEST(testResolveRecursion)
 
     CHECK(JS_DefineProperty(cx, global, "obj1", OBJECT_TO_JSVAL(obj1), NULL, NULL, 0));
     CHECK(JS_DefineProperty(cx, global, "obj2", OBJECT_TO_JSVAL(obj2), NULL, NULL, 0));
 
     resolveEntryCount = 0;
     resolveExitCount = 0;
 
     /* Start the essence of the test via invoking the first resolve hook. */
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     EVAL("obj1.x", v.address());
     CHECK_SAME(v, JSVAL_FALSE);
     CHECK_EQUAL(resolveEntryCount, 4);
     CHECK_EQUAL(resolveExitCount, 4);
     return true;
 }
 
 JSObject *obj1;
@@ -74,17 +74,17 @@ doResolve(JSHandleObject obj, JSHandleId
     CHECK_EQUAL(resolveExitCount, 0);
     AutoIncrCounters incr(this);
     CHECK_EQUAL(obj, obj1 || obj == obj2);
 
     CHECK(JSID_IS_STRING(id));
 
     JSFlatString *str = JS_FlattenString(cx, JSID_TO_STRING(id));
     CHECK(str);
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     if (JS_FlatStringEqualsAscii(str, "x")) {
         if (obj == obj1) {
             /* First resolve hook invocation. */
             CHECK_EQUAL(resolveEntryCount, 1);
             EVAL("obj2.y = true", v.address());
             CHECK_SAME(v, JSVAL_TRUE);
             CHECK(JS_DefinePropertyById(cx, obj, id, JSVAL_FALSE, NULL, NULL, 0));
             objp.set(obj);
--- a/js/src/jsapi-tests/testScriptInfo.cpp
+++ b/js/src/jsapi-tests/testScriptInfo.cpp
@@ -33,17 +33,17 @@ CharsMatch(const jschar *p, const char *
     return true;
 }
 
 // Bug 670958 - fix JS_GetScriptLineExtent, among others
 BEGIN_TEST(testScriptInfo)
 {
     unsigned startLine = 1000;
 
-    JS::RootedScript script(cx, JS_CompileScript(cx, global, code, strlen(code), __FILE__, startLine));
+    js::RootedScript script(cx, JS_CompileScript(cx, global, code, strlen(code), __FILE__, startLine));
 
     CHECK(script);
 
     jsbytecode *start = JS_LineNumberToPC(cx, script, startLine);
     CHECK_EQUAL(JS_GetScriptBaseLineNumber(cx, script), startLine);
     CHECK_EQUAL(JS_PCToLineNumber(cx, script, start), startLine);
     CHECK_EQUAL(JS_GetScriptLineExtent(cx, script), 11);
     CHECK(strcmp(JS_GetScriptFilename(cx, script), __FILE__) == 0);
--- a/js/src/jsapi-tests/testScriptObject.cpp
+++ b/js/src/jsapi-tests/testScriptObject.cpp
@@ -16,17 +16,17 @@ struct ScriptObjectFixture : public JSAP
     ScriptObjectFixture()
     {
         for (int i = 0; i < code_size; i++)
             uc_code[i] = code[i];
     }
 
     bool tryScript(JS::HandleObject global, JSScript *scriptArg)
     {
-        JS::RootedScript script(cx, scriptArg);
+        js::RootedScript script(cx, scriptArg);
         CHECK(script);
 
         JS_GC(rt);
 
         /* After a garbage collection, the script should still work. */
         jsval result;
         CHECK(JS_ExecuteScript(cx, global, script, &result));
 
--- a/js/src/jsapi-tests/testSetProperty.cpp
+++ b/js/src/jsapi-tests/testSetProperty.cpp
@@ -12,19 +12,19 @@ static JSBool
 nativeGet(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)
 {
     vp.set(INT_TO_JSVAL(17));
     return JS_TRUE;
 }
 
 BEGIN_TEST(testSetProperty_NativeGetterStubSetter)
 {
-    JS::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
+    js::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL));
     CHECK(obj);
-    JS::RootedValue vobj(cx, OBJECT_TO_JSVAL(obj));
+    js::RootedValue vobj(cx, OBJECT_TO_JSVAL(obj));
 
     CHECK(JS_DefineProperty(cx, global, "globalProp", vobj,
                             JS_PropertyStub, JS_StrictPropertyStub,
                             JSPROP_ENUMERATE));
 
     CHECK(JS_DefineProperty(cx, obj, "prop", JSVAL_VOID,
                             nativeGet, JS_StrictPropertyStub,
                             JSPROP_SHARED));
--- a/js/src/jsapi-tests/testStringBuffer.cpp
+++ b/js/src/jsapi-tests/testStringBuffer.cpp
@@ -14,17 +14,17 @@
 
 #include "jsobjinlines.h"
 
 BEGIN_TEST(testStringBuffer_finishString)
 {
     JSString *str = JS_NewStringCopyZ(cx, "foopy");
     CHECK(str);
 
-    JS::Rooted<JSAtom*> atom(cx, js::AtomizeString<js::CanGC>(cx, str));
+    js::Rooted<JSAtom*> atom(cx, js::AtomizeString<js::CanGC>(cx, str));
     CHECK(atom);
 
     js::StringBuffer buffer(cx);
     CHECK(buffer.append("foopy"));
 
     JSAtom *finishedAtom = buffer.finishAtom();
     CHECK(finishedAtom);
     CHECK_EQUAL(atom, finishedAtom);
--- a/js/src/jsapi-tests/testTrap.cpp
+++ b/js/src/jsapi-tests/testTrap.cpp
@@ -10,17 +10,17 @@
 #include "jsdbgapi.h"
 
 static int emptyTrapCallCount = 0;
 
 static JSTrapStatus
 EmptyTrapHandler(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,
                  jsval closureArg)
 {
-    JS::RootedValue closure(cx, closureArg);
+    js::RootedValue closure(cx, closureArg);
     JS_GC(JS_GetRuntime(cx));
     if (JSVAL_IS_STRING(closure))
         ++emptyTrapCallCount;
     return JSTRAP_CONTINUE;
 }
 
 BEGIN_TEST(testTrap_gc)
 {
@@ -30,33 +30,33 @@ BEGIN_TEST(testTrap_gc)
 "while (i < 10) {\n"
 "    sum += i;\n"
 "    ++i;\n"
 "}\n"
 "({ result: sum });\n"
         ;
 
     // compile
-    JS::RootedScript script(cx, JS_CompileScript(cx, global, source, strlen(source), __FILE__, 1));
+    js::RootedScript script(cx, JS_CompileScript(cx, global, source, strlen(source), __FILE__, 1));
     CHECK(script);
 
     // execute
-    JS::RootedValue v2(cx);
+    js::RootedValue v2(cx);
     CHECK(JS_ExecuteScript(cx, global, script, v2.address()));
     CHECK(v2.isObject());
     CHECK_EQUAL(emptyTrapCallCount, 0);
 
     // Enable debug mode
     CHECK(JS_SetDebugMode(cx, JS_TRUE));
 
     static const char trapClosureText[] = "some trap closure";
 
     // scope JSScript  usage to make sure that it is not used after
     // JS_ExecuteScript. This way we avoid using Anchor.
-    JS::RootedString trapClosure(cx);
+    js::RootedString trapClosure(cx);
     {
         jsbytecode *line2 = JS_LineNumberToPC(cx, script, 1);
         CHECK(line2);
 
         jsbytecode *line6 = JS_LineNumberToPC(cx, script, 5);
         CHECK(line2);
 
         trapClosure = JS_NewStringCopyZ(cx, trapClosureText);
--- a/js/src/jsapi-tests/testTypedArrays.cpp
+++ b/js/src/jsapi-tests/testTypedArrays.cpp
@@ -115,19 +115,19 @@ TestArrayFromBuffer(JSContext *cx)
     CHECK_EQUAL(JS_GetTypedArrayByteLength(shortArray), nbytes / 2);
 
     RootedObject ofsArray(cx, CreateWithBuffer(cx, buffer, nbytes / 2, -1));
     CHECK_EQUAL(JS_GetTypedArrayLength(ofsArray), elts / 2);
     CHECK_EQUAL(JS_GetTypedArrayByteOffset(ofsArray), nbytes / 2);
     CHECK_EQUAL(JS_GetTypedArrayByteLength(ofsArray), nbytes / 2);
 
     // Make sure all 3 views reflect the same buffer at the expected locations
-    JS::RootedValue v(cx, INT_TO_JSVAL(39));
+    js::RootedValue v(cx, INT_TO_JSVAL(39));
     JS_SetElement(cx, array, 0, v.address());
-    JS::RootedValue v2(cx);
+    js::RootedValue v2(cx);
     CHECK(JS_GetElement(cx, array, 0, v2.address()));
     CHECK_SAME(v, v2);
     CHECK(JS_GetElement(cx, shortArray, 0, v2.address()));
     CHECK_SAME(v, v2);
     CHECK_EQUAL(long(JSVAL_TO_INT(v)), long(reinterpret_cast<Element*>(data)[0]));
 
     v = INT_TO_JSVAL(40);
     JS_SetElement(cx, array, elts / 2, v.address());
@@ -140,17 +140,17 @@ TestArrayFromBuffer(JSContext *cx)
     v = INT_TO_JSVAL(41);
     JS_SetElement(cx, array, elts - 1, v.address());
     CHECK(JS_GetElement(cx, array, elts - 1, v2.address()));
     CHECK_SAME(v, v2);
     CHECK(JS_GetElement(cx, ofsArray, elts / 2 - 1, v2.address()));
     CHECK_SAME(v, v2);
     CHECK_EQUAL(long(JSVAL_TO_INT(v)), long(reinterpret_cast<Element*>(data)[elts - 1]));
 
-    JS::RootedObject copy(cx, CreateFromArray(cx, array));
+    js::RootedObject copy(cx, CreateFromArray(cx, array));
     CHECK(JS_GetElement(cx, array, 0, v.address()));
     CHECK(JS_GetElement(cx, copy, 0, v2.address()));
     CHECK_SAME(v, v2);
 
     /* The copy should not see changes in the original */
     v2 = INT_TO_JSVAL(42);
     JS_SetElement(cx, array, 0, v2.address());
     CHECK(JS_GetElement(cx, copy, 0, v2.address()));
--- a/js/src/jsapi-tests/testValueABI.cpp
+++ b/js/src/jsapi-tests/testValueABI.cpp
@@ -24,17 +24,17 @@ C_GetEmptyStringValue(JSContext *cx);
 
 extern size_t
 C_jsvalAlignmentTest();
 
 }
 
 BEGIN_TEST(testValueABI_retparam)
 {
-    JS::RootedObject obj(cx, JS_GetGlobalObject(cx));
+    js::RootedObject obj(cx, JS_GetGlobalObject(cx));
     jsval v = OBJECT_TO_JSVAL(obj);
     obj = NULL;
     CHECK(C_ValueToObject(cx, v, obj.address()));
     JSBool equal;
     CHECK(JS_StrictlyEqual(cx, v, OBJECT_TO_JSVAL(obj), &equal));
     CHECK(equal);
 
     v = C_GetEmptyStringValue(cx);
--- a/js/src/jsapi-tests/testVersion.cpp
+++ b/js/src/jsapi-tests/testVersion.cpp
@@ -31,27 +31,27 @@ struct VersionFixture : public JSAPITest
     JSVersion captured;
 
     virtual bool init() {
         if (!JSAPITest::init())
             return false;
         JS_SetOptions(cx, JS_GetOptions(cx));
         callbackData = this;
         captured = JSVERSION_UNKNOWN;
-        JS::RootedObject global(cx, JS_GetGlobalObject(cx));
+        js::RootedObject global(cx, JS_GetGlobalObject(cx));
         return JS_DefineFunction(cx, global, "callSetVersion17", CallSetVersion17, 0, 0) &&
                JS_DefineFunction(cx, global, "overrideVersion18", OverrideVersion18, 0, 0) &&
                JS_DefineFunction(cx, global, "captureVersion", CaptureVersion, 0, 0) &&
                JS_DefineFunction(cx, global, "checkOverride", CheckOverride, 1, 0) &&
                JS_DefineFunction(cx, global, "evalScriptVersion16",
                                  EvalScriptVersion16, 0, 0);
     }
 
     JSScript *fakeScript(const char *contents, size_t length) {
-        JS::RootedObject global(cx, JS_GetGlobalObject(cx));
+        js::RootedObject global(cx, JS_GetGlobalObject(cx));
         return JS_CompileScript(cx, global, contents, length, "<test>", 1);
     }
 
     bool checkVersionIsOverridden() {
         CHECK(cx->isVersionOverridden());
         return true;
     }
 
@@ -59,17 +59,17 @@ struct VersionFixture : public JSAPITest
         CHECK(JS_GetVersion(cx) != version);
         JS_SetVersion(cx, version);
         return true;
     }
 
     bool evalVersion(const jschar *chars, size_t len, JSVersion version) {
         CHECK(JS_GetVersion(cx) != version);
         jsval rval;
-        JS::RootedObject global(cx, JS_GetGlobalObject(cx));
+        js::RootedObject global(cx, JS_GetGlobalObject(cx));
         CHECK(JS_EvaluateUCScriptForPrincipalsVersion(
                 cx, global, NULL, chars, len, "<test>", 0, &rval, version));
         return true;
     }
 };
 
 /* Callbacks to throw into JS-land. */
 
--- a/js/src/jsapi-tests/testXDR.cpp
+++ b/js/src/jsapi-tests/testXDR.cpp
@@ -117,36 +117,36 @@ enum TestCase {
 };
 
 JSScript *createScriptViaXDR(JSPrincipals *prin, JSPrincipals *orig, int testCase)
 {
     const char src[] =
         "function f() { return 1; }\n"
         "f;\n";
 
-    JS::RootedObject global(cx, JS_GetGlobalObject(cx));
+    js::RootedObject global(cx, JS_GetGlobalObject(cx));
     JSScript *script = CompileScriptForPrincipalsVersionOrigin(cx, global, prin, orig,
                                                                src, strlen(src), "test", 1,
                                                                JSVERSION_DEFAULT);
     if (!script)
         return NULL;
 
     if (testCase == TEST_SCRIPT || testCase == TEST_SERIALIZED_FUNCTION) {
         script = FreezeThaw(cx, script);
         if (!script)
             return NULL;
         if (testCase == TEST_SCRIPT)
             return script;
     }
 
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     JSBool ok = JS_ExecuteScript(cx, global, script, v.address());
     if (!ok || !v.isObject())
         return NULL;
-    JS::RootedObject funobj(cx, &v.toObject());
+    js::RootedObject funobj(cx, &v.toObject());
     if (testCase == TEST_FUNCTION) {
         funobj = FreezeThaw(cx, funobj);
         if (!funobj)
             return NULL;
     }
     return GetScript(cx, funobj);
 }
 
@@ -163,22 +163,22 @@ BEGIN_TEST(testXDR_atline)
 "//@line 200 \"bar\"\n"
 "nested;\n";
 
     JSScript *script = JS_CompileScript(cx, global, src, strlen(src), "internal", 1);
     CHECK(script);
     CHECK(script = FreezeThaw(cx, script));
     CHECK(!strcmp("bar", JS_GetScriptFilename(cx, script)));
 
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     JSBool ok = JS_ExecuteScript(cx, global, script, v.address());
     CHECK(ok);
     CHECK(v.isObject());
 
-    JS::RootedObject funobj(cx, &v.toObject());
+    js::RootedObject funobj(cx, &v.toObject());
     script = JS_GetFunctionScript(cx, JS_GetObjectFunction(funobj));
     CHECK(!strcmp("foo", JS_GetScriptFilename(cx, script)));
 
     return true;
 }
 
 END_TEST(testXDR_atline)
 
@@ -195,25 +195,25 @@ BEGIN_TEST(testXDR_bug506491)
     // compile
     JSScript *script = JS_CompileScript(cx, global, s, strlen(s), __FILE__, __LINE__);
     CHECK(script);
 
     script = FreezeThaw(cx, script);
     CHECK(script);
 
     // execute
-    JS::RootedValue v2(cx);
+    js::RootedValue v2(cx);
     CHECK(JS_ExecuteScript(cx, global, script, v2.address()));
 
     // try to break the Block object that is the parent of f
     JS_GC(rt);
 
     // confirm
     EVAL("f() === 'ok';\n", v2.address());
-    JS::RootedValue trueval(cx, JSVAL_TRUE);
+    js::RootedValue trueval(cx, JSVAL_TRUE);
     CHECK_SAME(v2, trueval);
     return true;
 }
 END_TEST(testXDR_bug506491)
 
 BEGIN_TEST(testXDR_bug516827)
 {
     // compile an empty script
@@ -254,17 +254,17 @@ END_TEST(testXDR_source)
 
 BEGIN_TEST(testXDR_sourceMap)
 {
     const char *sourceMaps[] = {
         "http://example.com/source-map.json",
         "file:///var/source-map.json",
         NULL
     };
-    JS::RootedScript script(cx);
+    js::RootedScript script(cx);
     for (const char **sm = sourceMaps; *sm; sm++) {
         script = JS_CompileScript(cx, global, "", 0, __FILE__, __LINE__);
         CHECK(script);
 
         size_t len = strlen(*sm);
         jschar *expected = js::InflateString(cx, *sm, &len);
         CHECK(expected);
 
--- a/js/src/jsapi-tests/tests.cpp
+++ b/js/src/jsapi-tests/tests.cpp
@@ -16,26 +16,26 @@ bool JSAPITest::init()
 {
     rt = createRuntime();
     if (!rt)
         return false;
     cx = createContext();
     if (!cx)
         return false;
     JS_BeginRequest(cx);
-    JS::RootedObject global(cx, createGlobal());
+    js::RootedObject global(cx, createGlobal());
     if (!global)
         return false;
     oldCompartment = JS_EnterCompartment(cx, global);
     return oldCompartment != NULL;
 }
 
 bool JSAPITest::exec(const char *bytes, const char *filename, int lineno)
 {
-    JS::RootedValue v(cx);
+    js::RootedValue v(cx);
     JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&this->global);
     return JS_EvaluateScript(cx, global, bytes, strlen(bytes), filename, lineno, v.address()) ||
         fail(bytes, filename, lineno);
 }
 
 bool JSAPITest::evaluate(const char *bytes, const char *filename, int lineno, jsval *vp)
 {
     JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&this->global);
--- a/js/src/jsapi-tests/tests.h
+++ b/js/src/jsapi-tests/tests.h
@@ -183,17 +183,17 @@ class JSAPITest
         if (!checkEqual(actual, expected, #actual, #expected, __FILE__, __LINE__)) \
             return false; \
     } while (false)
 
     bool checkSame(jsval actualArg, jsval expectedArg,
                    const char *actualExpr, const char *expectedExpr,
                    const char *filename, int lineno) {
         JSBool same;
-        JS::RootedValue actual(cx, actualArg), expected(cx, expectedArg);
+        js::RootedValue actual(cx, actualArg), expected(cx, expectedArg);
         return (JS_SameValue(cx, actual, expected, &same) && same) ||
                fail(JSAPITestString("CHECK_SAME failed: expected JS_SameValue(cx, ") +
                     actualExpr + ", " + expectedExpr + "), got !JS_SameValue(cx, " +
                     jsvalToSource(actual) + ", " + jsvalToSource(expected) + ")", filename, lineno);
     }
 
 #define CHECK_SAME(actual, expected) \
     do { \
@@ -205,17 +205,17 @@ class JSAPITest
     do { \
         if (!(expr)) \
             return fail("CHECK failed: " #expr, __FILE__, __LINE__); \
     } while (false)
 
     bool fail(JSAPITestString msg = JSAPITestString(), const char *filename = "-", int lineno = 0) {
         if (JS_IsExceptionPending(cx)) {
             js::gc::AutoSuppressGC gcoff(cx);
-            JS::RootedValue v(cx);
+            js::RootedValue v(cx);
             JS_GetPendingException(cx, v.address());
             JS_ClearPendingException(cx);
             JSString *s = JS_ValueToString(cx, v);
             if (s) {
                 JSAutoByteString bytes(cx, s);
                 if (!!bytes)
                     msg += bytes.ptr();
             }
--- a/js/src/jsclone.h
+++ b/js/src/jsclone.h
@@ -86,17 +86,17 @@ struct SCInput {
         JS_STATIC_ASSERT(sizeof(double) == 8);
     }
 
     JSContext *cx;
     uint64_t *point;
     uint64_t *end;
 };
 
-} /* namespace js */
+}
 
 struct JSStructuredCloneReader {
   public:
     explicit JSStructuredCloneReader(js::SCInput &in, const JSStructuredCloneCallbacks *cb,
                                      void *cbClosure)
         : in(in), objs(in.context()), allObjs(in.context()),
           callbacks(cb), closure(cbClosure) { }
 
@@ -191,15 +191,15 @@ struct JSStructuredCloneWriter {
 
     // The user defined callbacks that will be used for cloning.
     const JSStructuredCloneCallbacks *callbacks;
 
     // Any value passed to JS_WriteStructuredClone.
     void *closure;
 
     // List of transferable objects
-    JS::RootedValue transferable;
+    js::RootedValue transferable;
     js::AutoObjectHashSet transferableObjects;
 
     friend JSBool JS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v);
 };
 
 #endif /* jsclone_h___ */
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -180,17 +180,17 @@ class JSFunction : public JSObject
     static inline size_t offsetOfEnvironment() { return offsetof(JSFunction, u.i.env_); }
     static inline size_t offsetOfAtom() { return offsetof(JSFunction, atom_); }
 
     bool initializeLazyScript(JSContext *cx);
 
     js::RawScript getOrCreateScript(JSContext *cx) {
         JS_ASSERT(isInterpreted());
         if (isInterpretedLazy()) {
-            JS::RootedFunction self(cx, this);
+            js::RootedFunction self(cx, this);
             js::MaybeCheckStackRoots(cx);
             if (!self->initializeLazyScript(cx))
                 return NULL;
             return self->u.i.script_;
         }
         JS_ASSERT(hasScript());
         return u.i.script_;
     }
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -529,17 +529,17 @@ GetClassForProtoKey(JSProtoKey key)
 
 /*
  * Get the default 'new' object for a given standard class, per the currently
  * active global.
  */
 inline TypeObject *
 GetTypeNewObject(JSContext *cx, JSProtoKey key)
 {
-    RootedObject proto(cx);
+    js::RootedObject proto(cx);
     if (!js_GetClassPrototype(cx, key, &proto))
         return NULL;
     return proto->getNewType(cx, GetClassForProtoKey(key));
 }
 
 /* Get a type object for the immediate allocation site within a native. */
 inline TypeObject *
 GetTypeCallerInitObject(JSContext *cx, JSProtoKey key)
@@ -842,17 +842,17 @@ TypeScript::SlotTypes(RawScript script, 
     JS_ASSERT(slot < js::analyze::TotalSlots(script));
     TypeSet *types = script->types->typeArray() + script->nTypeSets + slot;
     return types->toStackTypeSet();
 }
 
 /* static */ inline TypeObject *
 TypeScript::StandardType(JSContext *cx, JSProtoKey key)
 {
-    RootedObject proto(cx);
+    js::RootedObject proto(cx);
     if (!js_GetClassPrototype(cx, key, &proto, NULL))
         return NULL;
     return proto->getNewType(cx, GetClassForProtoKey(key));
 }
 
 struct AllocationSiteKey {
     JSScript *script;
 
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -768,40 +768,40 @@ class JSObject : public js::ObjectImpl
     static js::RawShape addProperty(JSContext *cx, JS::HandleObject, JS::HandleId id,
                                     JSPropertyOp getter, JSStrictPropertyOp setter,
                                     uint32_t slot, unsigned attrs, unsigned flags,
                                     int shortid, bool allowDictionary = true);
 
     /* Add a data property whose id is not yet in this scope. */
     js::RawShape addDataProperty(JSContext *cx, jsid id_, uint32_t slot, unsigned attrs) {
         JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
-        JS::RootedObject self(cx, this);
-        JS::RootedId id(cx, id_);
+        js::RootedObject self(cx, this);
+        js::RootedId id(cx, id_);
         return addProperty(cx, self, id, NULL, NULL, slot, attrs, 0, 0);
     }
 
     js::RawShape addDataProperty(JSContext *cx, js::HandlePropertyName name, uint32_t slot, unsigned attrs) {
         JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
-        JS::RootedObject self(cx, this);
-        JS::RootedId id(cx, NameToId(name));
+        js::RootedObject self(cx, this);
+        js::RootedId id(cx, NameToId(name));
         return addProperty(cx, self, id, NULL, NULL, slot, attrs, 0, 0);
     }
 
     /* Add or overwrite a property for id in this scope. */
     static js::RawShape putProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
                                     JSPropertyOp getter, JSStrictPropertyOp setter,
                                     uint32_t slot, unsigned attrs,
                                     unsigned flags, int shortid);
     static js::RawShape putProperty(JSContext *cx, JS::HandleObject obj,
                                     js::PropertyName *name,
                                     JSPropertyOp getter, JSStrictPropertyOp setter,
                                     uint32_t slot, unsigned attrs,
                                     unsigned flags, int shortid)
     {
-        JS::RootedId id(cx, js::NameToId(name));
+        js::RootedId id(cx, js::NameToId(name));
         return putProperty(cx, obj, id, getter, setter, slot, attrs, flags, shortid);
     }
 
     /* Change the given property into a sibling with the same id in this scope. */
     static js::RawShape changeProperty(JSContext *cx, js::HandleObject obj,
                                        js::HandleShape shape, unsigned attrs, unsigned mask,
                                        JSPropertyOp getter, JSStrictPropertyOp setter);
 
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -88,67 +88,67 @@ JSObject::setGeneric(JSContext *cx, js::
         return nonNativeSetProperty(cx, obj, id, vp, strict);
     return js::baseops::SetPropertyHelper(cx, obj, receiver, id, 0, vp, strict);
 }
 
 /* static */ inline JSBool
 JSObject::setProperty(JSContext *cx, js::HandleObject obj, js::HandleObject receiver,
                       js::PropertyName *name, js::MutableHandleValue vp, JSBool strict)
 {
-    JS::RootedId id(cx, js::NameToId(name));
+    js::RootedId id(cx, js::NameToId(name));
     return setGeneric(cx, obj, receiver, id, vp, strict);
 }
 
 /* static */ inline JSBool
 JSObject::setElement(JSContext *cx, js::HandleObject obj, js::HandleObject receiver,
                      uint32_t index, js::MutableHandleValue vp, JSBool strict)
 {
     if (obj->getOps()->setElement)
         return nonNativeSetElement(cx, obj, index, vp, strict);
     return js::baseops::SetElementHelper(cx, obj, receiver, index, 0, vp, strict);
 }
 
 /* static */ inline JSBool
 JSObject::setSpecial(JSContext *cx, js::HandleObject obj, js::HandleObject receiver,
                      js::SpecialId sid, js::MutableHandleValue vp, JSBool strict)
 {
-    JS::RootedId id(cx, SPECIALID_TO_JSID(sid));
+    js::RootedId id(cx, SPECIALID_TO_JSID(sid));
     return setGeneric(cx, obj, receiver, id, vp, strict);
 }
 
 /* static */ inline JSBool
 JSObject::setGenericAttributes(JSContext *cx, js::HandleObject obj,
                                js::HandleId id, unsigned *attrsp)
 {
     js::types::MarkTypePropertyConfigured(cx, obj, id);
     js::GenericAttributesOp op = obj->getOps()->setGenericAttributes;
     return (op ? op : js::baseops::SetAttributes)(cx, obj, id, attrsp);
 }
 
 /* static */ inline JSBool
 JSObject::setPropertyAttributes(JSContext *cx, js::HandleObject obj,
                                 js::PropertyName *name, unsigned *attrsp)
 {
-    JS::RootedId id(cx, js::NameToId(name));
+    js::RootedId id(cx, js::NameToId(name));
     return setGenericAttributes(cx, obj, id, attrsp);
 }
 
 /* static */ inline JSBool
 JSObject::setElementAttributes(JSContext *cx, js::HandleObject obj,
                                uint32_t index, unsigned *attrsp)
 {
     js::ElementAttributesOp op = obj->getOps()->setElementAttributes;
     return (op ? op : js::baseops::SetElementAttributes)(cx, obj, index, attrsp);
 }
 
 /* static */ inline JSBool
 JSObject::setSpecialAttributes(JSContext *cx, js::HandleObject obj,
                                js::SpecialId sid, unsigned *attrsp)
 {
-    JS::RootedId id(cx, SPECIALID_TO_JSID(sid));
+    js::RootedId id(cx, SPECIALID_TO_JSID(sid));
     return setGenericAttributes(cx, obj, id, attrsp);
 }
 
 /* static */ inline bool
 JSObject::changePropertyAttributes(JSContext *cx, js::HandleObject obj,
                                    js::HandleShape shape, unsigned attrs)
 {
     return !!changeProperty(cx, obj, shape, attrs, 0, shape->getter(), shape->setter());
@@ -178,56 +178,56 @@ JSObject::getGenericNoGC(JSContext *cx, 
         return false;
     return js::baseops::GetPropertyNoGC(cx, obj, receiver, id, vp);
 }
 
 /* static */ inline JSBool
 JSObject::getProperty(JSContext *cx, js::HandleObject obj, js::HandleObject receiver,
                       js::PropertyName *name, js::MutableHandleValue vp)
 {
-    JS::RootedId id(cx, js::NameToId(name));
+    js::RootedId id(cx, js::NameToId(name));
     return getGeneric(cx, obj, receiver, id, vp);
 }
 
 /* static */ inline JSBool
 JSObject::getPropertyNoGC(JSContext *cx, JSObject *obj, JSObject *receiver,
                           js::PropertyName *name, js::Value *vp)
 {
     return getGenericNoGC(cx, obj, receiver, js::NameToId(name), vp);
 }
 
 /* static */ inline bool
 JSObject::deleteProperty(JSContext *cx, js::HandleObject obj,
                          js::HandlePropertyName name, js::MutableHandleValue rval, bool strict)
 {
-    JS::RootedId id(cx, js::NameToId(name));
+    js::RootedId id(cx, js::NameToId(name));
     js::types::AddTypePropertyId(cx, obj, id, js::types::Type::UndefinedType());
     js::types::MarkTypePropertyConfigured(cx, obj, id);
     js::DeletePropertyOp op = obj->getOps()->deleteProperty;
     return (op ? op : js::baseops::DeleteProperty)(cx, obj, name, rval, strict);
 }
 
 /* static */ inline bool
 JSObject::deleteElement(JSContext *cx, js::HandleObject obj,
                         uint32_t index, js::MutableHandleValue rval, bool strict)
 {
-    JS::RootedId id(cx);
+    js::RootedId id(cx);
     if (!js::IndexToId(cx, index, &id))
         return false;
     js::types::AddTypePropertyId(cx, obj, id, js::types::Type::UndefinedType());
     js::types::MarkTypePropertyConfigured(cx, obj, id);
     js::DeleteElementOp op = obj->getOps()->deleteElement;
     return (op ? op : js::baseops::DeleteElement)(cx, obj, index, rval, strict);
 }
 
 /* static */ inline bool
 JSObject::deleteSpecial(JSContext *cx, js::HandleObject obj,
                         js::HandleSpecialId sid, js::MutableHandleValue rval, bool strict)
 {
-    JS::RootedId id(cx, SPECIALID_TO_JSID(sid));
+    js::RootedId id(cx, SPECIALID_TO_JSID(sid));
     js::types::AddTypePropertyId(cx, obj, id, js::types::Type::UndefinedType());
     js::types::MarkTypePropertyConfigured(cx, obj, id);
     js::DeleteSpecialOp op = obj->getOps()->deleteSpecial;
     return (op ? op : js::baseops::DeleteSpecial)(cx, obj, sid, rval, strict);
 }
 
 inline void
 JSObject::finalize(js::FreeOp *fop)
@@ -287,17 +287,17 @@ JSObject::setLastPropertyInfallible(js::
 
     shape_ = shape;
 }
 
 inline void
 JSObject::removeLastProperty(JSContext *cx)
 {
     JS_ASSERT(canRemoveLastProperty());
-    JS::RootedObject self(cx, this);
+    js::RootedObject self(cx, this);
     js::RootedShape prev(cx, lastProperty()->previous());
     JS_ALWAYS_TRUE(setLastProperty(cx, self, prev));
 }
 
 inline bool
 JSObject::canRemoveLastProperty()
 {
     /*
@@ -754,17 +754,17 @@ JSObject::setSingletonType(JSContext *cx
     return true;
 }
 
 inline js::types::TypeObject*
 JSObject::getType(JSContext *cx)
 {
     JS_ASSERT(cx->compartment == compartment());
     if (hasLazyType()) {
-        JS::RootedObject self(cx, this);
+        js::RootedObject self(cx, this);
         return makeLazyType(cx, self);
     }
     return static_cast<js::types::TypeObject*>(type_);
 }
 
 /* static */ inline bool
 JSObject::clearType(JSContext *cx, js::HandleObject obj)
 {
@@ -1009,17 +1009,17 @@ JSObject::finish(js::FreeOp *fop)
     if (hasDynamicElements())
         fop->free_(getElementsHeader());
 }
 
 /* static */ inline bool
 JSObject::hasProperty(JSContext *cx, js::HandleObject obj,
                       js::HandleId id, bool *foundp, unsigned flags)
 {
-    JS::RootedObject pobj(cx);
+    js::RootedObject pobj(cx);
     js::RootedShape prop(cx);
     JSAutoResolveFlags rf(cx, flags);
     if (!lookupGeneric(cx, obj, id, &pobj, &prop)) {
         *foundp = false;  /* initialize to shut GCC up */
         return false;
     }
     *foundp = !!prop;
     return true;
@@ -1119,17 +1119,17 @@ JSObject::lookupGeneric(JSContext *cx, j
         return op(cx, obj, id, objp, propp);
     return js::baseops::LookupProperty<js::CanGC>(cx, obj, id, objp, propp);
 }
 
 /* static */ inline JSBool
 JSObject::lookupProperty(JSContext *cx, js::HandleObject obj, js::PropertyName *name,
                          js::MutableHandleObject objp, js::MutableHandleShape propp)
 {
-    JS::RootedId id(cx, js::NameToId(name));
+    js::RootedId id(cx, js::NameToId(name));
     return lookupGeneric(cx, obj, id, objp, propp);
 }
 
 /* static */ inline JSBool
 JSObject::defineGeneric(JSContext *cx, js::HandleObject obj,
                         js::HandleId id, js::HandleValue value,
                         JSPropertyOp getter /* = JS_PropertyStub */,
                         JSStrictPropertyOp setter /* = JS_StrictPropertyStub */,
@@ -1142,17 +1142,17 @@ JSObject::defineGeneric(JSContext *cx, j
 
 /* static */ inline JSBool
 JSObject::defineProperty(JSContext *cx, js::HandleObject obj,
                          js::PropertyName *name, js::HandleValue value,
                         JSPropertyOp getter /* = JS_PropertyStub */,
                         JSStrictPropertyOp setter /* = JS_StrictPropertyStub */,
                         unsigned attrs /* = JSPROP_ENUMERATE */)
 {
-    JS::RootedId id(cx, js::NameToId(name));
+    js::RootedId id(cx, js::NameToId(name));
     return defineGeneric(cx, obj, id, value, getter, setter, attrs);
 }
 
 /* static */ inline JSBool
 JSObject::defineElement(JSContext *cx, js::HandleObject obj,
                         uint32_t index, js::HandleValue value,
                         JSPropertyOp getter /* = JS_PropertyStub */,
                         JSStrictPropertyOp setter /* = JS_StrictPropertyStub */,
@@ -1163,45 +1163,45 @@ JSObject::defineElement(JSContext *cx, j
 }
 
 /* static */ inline JSBool
 JSObject::defineSpecial(JSContext *cx, js::HandleObject obj, js::SpecialId sid, js::HandleValue value,
                         JSPropertyOp getter /* = JS_PropertyStub */,
                         JSStrictPropertyOp setter /* = JS_StrictPropertyStub */,
                         unsigned attrs /* = JSPROP_ENUMERATE */)
 {
-    JS::RootedId id(cx, SPECIALID_TO_JSID(sid));
+    js::RootedId id(cx, SPECIALID_TO_JSID(sid));
     return defineGeneric(cx, obj, id, value, getter, setter, attrs);
 }
 
 /* static */ inline JSBool
 JSObject::lookupElement(JSContext *cx, js::HandleObject obj, uint32_t index,
                         js::MutableHandleObject objp, js::MutableHandleShape propp)
 {
     js::LookupElementOp op = obj->getOps()->lookupElement;
     return (op ? op : js::baseops::LookupElement)(cx, obj, index, objp, propp);
 }
 
 /* static */ inline JSBool
 JSObject::lookupSpecial(JSContext *cx, js::HandleObject obj, js::SpecialId sid,
                         js::MutableHandleObject objp, js::MutableHandleShape propp)
 {
-    JS::RootedId id(cx, SPECIALID_TO_JSID(sid));
+    js::RootedId id(cx, SPECIALID_TO_JSID(sid));
     return lookupGeneric(cx, obj, id, objp, propp);
 }
 
 /* static */ inline JSBool
 JSObject::getElement(JSContext *cx, js::HandleObject obj, js::HandleObject receiver,
                      uint32_t index, js::MutableHandleValue vp)
 {
     js::ElementIdOp op = obj->getOps()->getElement;
     if (op)
         return op(cx, obj, receiver, index, vp);
 
-    JS::RootedId id(cx);
+    js::RootedId id(cx);
     if (!js::IndexToId(cx, index, &id))
         return false;
     return getGeneric(cx, obj, receiver, id, vp);
 }
 
 /* static */ inline JSBool
 JSObject::getElementNoGC(JSContext *cx, JSObject *obj, JSObject *receiver,
                          uint32_t index, js::Value *vp)
@@ -1225,21 +1225,21 @@ JSObject::getElementIfPresent(JSContext 
     if (op)
         return op(cx, obj, receiver, index, vp, present);
 
     /*
      * For now, do the index-to-id conversion just once, then use
      * lookupGeneric/getGeneric.  Once lookupElement and getElement stop both
      * doing index-to-id conversions, we can use those here.
      */
-    JS::RootedId id(cx);
+    js::RootedId id(cx);
     if (!js::IndexToId(cx, index, &id))
         return false;
 
-    JS::RootedObject obj2(cx);
+    js::RootedObject obj2(cx);
     js::RootedShape prop(cx);
     if (!lookupGeneric(cx, obj, id, &obj2, &prop))
         return false;
 
     if (!prop) {
         *present = false;
         return true;
     }
@@ -1247,51 +1247,51 @@ JSObject::getElementIfPresent(JSContext 
     *present = true;
     return getGeneric(cx, obj, receiver, id, vp);
 }
 
 /* static */ inline JSBool
 JSObject::getSpecial(JSContext *cx, js::HandleObject obj, js::HandleObject receiver,
                      js::SpecialId sid, js::MutableHandleValue vp)
 {
-    JS::RootedId id(cx, SPECIALID_TO_JSID(sid));
+    js::RootedId id(cx, SPECIALID_TO_JSID(sid));
     return getGeneric(cx, obj, receiver, id, vp);
 }
 
 /* static */ inline JSBool
 JSObject::getGenericAttributes(JSContext *cx, js::HandleObject obj,
                                js::HandleId id, unsigned *attrsp)
 {
     js::GenericAttributesOp op = obj->getOps()->getGenericAttributes;
     return (op ? op : js::baseops::GetAttributes)(cx, obj, id, attrsp);
 }
 
 /* static */ inline JSBool
 JSObject::getPropertyAttributes(JSContext *cx, js::HandleObject obj,
                                 js::PropertyName *name, unsigned *attrsp)
 {
-    JS::RootedId id(cx, js::NameToId(name));
+    js::RootedId id(cx, js::NameToId(name));
     return getGenericAttributes(cx, obj, id, attrsp);
 }
 
 /* static */ inline JSBool
 JSObject::getElementAttributes(JSContext *cx, js::HandleObject obj,
                                uint32_t index, unsigned *attrsp)
 {
-    JS::RootedId id(cx);
+    js::RootedId id(cx);
     if (!js::IndexToId(cx, index, &id))
         return false;
     return getGenericAttributes(cx, obj, id, attrsp);
 }
 
 /* static */ inline JSBool
 JSObject::getSpecialAttributes(JSContext *cx, js::HandleObject obj,
                                js::SpecialId sid, unsigned *attrsp)
 {
-    JS::RootedId id(cx, SPECIALID_TO_JSID(sid));
+    js::RootedId id(cx, SPECIALID_TO_JSID(sid));
     return getGenericAttributes(cx, obj, id, attrsp);
 }
 
 inline bool
 JSObject::isProxy() const
 {
     return js::IsProxy(const_cast<JSObject*>(this));
 }
@@ -1789,17 +1789,17 @@ ObjectClassIs(HandleObject obj, ESClassV
     return false;
 }
 
 inline bool
 IsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx)
 {
     if (!v.isObject())
         return false;
-    RootedObject obj(cx, &v.toObject());
+    js::RootedObject obj(cx, &v.toObject());
     return ObjectClassIs(obj, classValue, cx);
 }
 
 static JS_ALWAYS_INLINE bool
 ValueMightBeSpecial(const Value &propval)
 {
     return propval.isObject();
 }
--- a/js/src/jsprvtd.h
+++ b/js/src/jsprvtd.h
@@ -191,20 +191,20 @@ struct TypeCompartment;
 typedef JS::Handle<Shape*>             HandleShape;
 typedef JS::Handle<types::TypeObject*> HandleTypeObject;
 typedef JS::Handle<JSAtom*>            HandleAtom;
 typedef JS::Handle<PropertyName*>      HandlePropertyName;
 
 typedef JS::MutableHandle<Shape*>      MutableHandleShape;
 typedef JS::MutableHandle<JSAtom*>     MutableHandleAtom;
 
-typedef JS::Rooted<Shape*>             RootedShape;
-typedef JS::Rooted<types::TypeObject*> RootedTypeObject;
-typedef JS::Rooted<JSAtom*>            RootedAtom;
-typedef JS::Rooted<PropertyName*>      RootedPropertyName;
+typedef js::Rooted<Shape*>             RootedShape;
+typedef js::Rooted<types::TypeObject*> RootedTypeObject;
+typedef js::Rooted<JSAtom*>            RootedAtom;
+typedef js::Rooted<PropertyName*>      RootedPropertyName;
 
 enum XDRMode {
     XDR_ENCODE,
     XDR_DECODE
 };
 
 template <XDRMode mode>
 class XDRState;
--- a/js/src/perf/jsperf.cpp
+++ b/js/src/perf/jsperf.cpp
@@ -164,17 +164,17 @@ static JSClass pm_class = {
 
 static JSBool
 pm_construct(JSContext* cx, unsigned argc, jsval* vp)
 {
     uint32_t mask;
     if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "u", &mask))
         return JS_FALSE;
 
-    JS::RootedObject obj(cx, JS_NewObjectForConstructor(cx, &pm_class, vp));
+    js::RootedObject obj(cx, JS_NewObjectForConstructor(cx, &pm_class, vp));
     if (!obj)
         return JS_FALSE;
 
     if (!JS_FreezeObject(cx, obj))
         return JS_FALSE;
 
     PerfMeasurement* p = cx->new_<PerfMeasurement>(PerfMeasurement::EventMask(mask));
     if (!p) {
@@ -220,24 +220,24 @@ GetPMFromThis(JSContext* cx, jsval* vp)
         JS_GetInstancePrivate(cx, this_, &pm_class, JS_ARGV(cx, vp));
 }
 
 namespace JS {
 
 JSObject*
 RegisterPerfMeasurement(JSContext *cx, JSRawObject global)
 {
-    RootedObject prototype(cx);
+    js::RootedObject prototype(cx);
     prototype = JS_InitClass(cx, global, NULL /* parent */,
                              &pm_class, pm_construct, 1,
                              pm_props, pm_fns, 0, 0);
     if (!prototype)
         return 0;
 
-    RootedObject ctor(cx);
+    js::RootedObject ctor(cx);
     ctor = JS_GetConstructor(cx, prototype);
     if (!ctor)
         return 0;
 
     for (const pm_const *c = pm_consts; c->name; c++) {
         if (!JS_DefineProperty(cx, ctor, c->name, INT_TO_JSVAL(c->value),
                                JS_PropertyStub, JS_StrictPropertyStub, PM_CATTRS))
             return 0;
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -4571,17 +4571,17 @@ static JSClass dom_class = {
 static JSClass *GetDomClass() {
     return &dom_class;
 }
 #endif
 
 static JSBool
 dom_genericGetter(JSContext *cx, unsigned argc, JS::Value *vp)
 {
-    RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
+    js::RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
     if (!obj)
         return false;
 
     if (JS_GetClass(obj) != &dom_class) {
         JS_SET_RVAL(cx, vp, UndefinedValue());
         return true;
     }
 
@@ -4591,17 +4591,17 @@ dom_genericGetter(JSContext *cx, unsigne
     MOZ_ASSERT(info->type == JSJitInfo::Getter);
     JSJitPropertyOp getter = info->op;
     return getter(cx, obj, val.toPrivate(), vp);
 }
 
 static JSBool
 dom_genericSetter(JSContext* cx, unsigned argc, JS::Value* vp)
 {
-    RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
+    js::RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
     if (!obj)
         return false;
 
     JS_ASSERT(argc == 1);
 
     if (JS_GetClass(obj) != &dom_class) {
         JS_SET_RVAL(cx, vp, UndefinedValue());
         return true;
@@ -4617,17 +4617,17 @@ dom_genericSetter(JSContext* cx, unsigne
         return false;
     JS_SET_RVAL(cx, vp, UndefinedValue());
     return true;
 }
 
 static JSBool
 dom_genericMethod(JSContext* cx, unsigned argc, JS::Value *vp)
 {
-    RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
+    js::RootedObject obj(cx, JS_THIS_OBJECT(cx, vp));
     if (!obj)
         return false;
 
     if (JS_GetClass(obj) != &dom_class) {
         JS_SET_RVAL(cx, vp, UndefinedValue());
         return true;
     }
 
--- a/js/src/vm/String-inl.h
+++ b/js/src/vm/String-inl.h
@@ -247,17 +247,17 @@ JSDependentString::new_(JSContext *cx, J
         return js::NewShortString<js::CanGC>(cx, js::TwoByteChars(chars, length));
 
     JSDependentString *str = (JSDependentString *)js_NewGCString<js::NoGC>(cx);
     if (str) {
         str->init(baseArg, chars, length);
         return str;
     }
 
-    JS::Rooted<JSLinearString*> base(cx, baseArg);
+    js::Rooted<JSLinearString*> base(cx, baseArg);
 
     str = (JSDependentString *)js_NewGCString<js::CanGC>(cx);
     if (!str)
         return NULL;
     str->init(base, chars, length);
     return str;
 }