Bug 712873 - Part 2: Replace JS_ASSERT with MOZ_ASSERT outside js/src/ directory. r=luke
authorChris Peterson <cpeterson@mozilla.com>
Mon, 17 Feb 2014 22:24:15 -0800
changeset 169823 16add78c43e39be93093da4bc0fdde1727d051ab
parent 169822 39adab158c172e7bfbbff8a1241081c14e03ad79
child 169824 37193db7e15b6c2b5241e13ee344ecba77c2d892
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersluke
bugs712873
milestone30.0a1
Bug 712873 - Part 2: Replace JS_ASSERT with MOZ_ASSERT outside js/src/ directory. r=luke
js/ipc/JavaScriptShared.cpp
js/jsd/jsd.h
js/jsd/jsd_atom.cpp
js/jsd/jsd_high.cpp
js/jsd/jsd_hook.cpp
js/jsd/jsd_lock.cpp
js/jsd/jsd_obj.cpp
js/jsd/jsd_scpt.cpp
js/jsd/jsd_stak.cpp
js/jsd/jsd_step.cpp
js/jsd/jsd_text.cpp
js/jsd/jsd_val.cpp
js/jsd/jsdebug.cpp
js/jsd/jshash.cpp
js/public/CharacterEncoding.h
js/public/Class.h
js/public/GCAPI.h
js/public/HashTable.h
js/public/HeapAPI.h
js/public/Id.h
js/public/ProfilingStack.h
js/public/RootingAPI.h
js/xpconnect/src/Sandbox.cpp
--- a/js/ipc/JavaScriptShared.cpp
+++ b/js/ipc/JavaScriptShared.cpp
@@ -175,17 +175,17 @@ JavaScriptShared::toVariant(JSContext *c
         return true;
       }
 
       case JSTYPE_OBJECT:
       case JSTYPE_FUNCTION:
       {
         RootedObject obj(cx, from.toObjectOrNull());
         if (!obj) {
-            JS_ASSERT(from == JSVAL_NULL);
+            MOZ_ASSERT(from == JSVAL_NULL);
             *to = uint64_t(0);
             return true;
         }
 
         if (xpc_JSObjectIsID(cx, obj)) {
             JSIID iid;
             const nsID *id = xpc_JSObjectToID(cx, obj);
             ConvertID(*id, &iid);
--- a/js/jsd/jsd.h
+++ b/js/jsd/jsd.h
@@ -729,23 +729,23 @@ jsd_SetException(JSDContext* jsdc, JSDTh
 #ifdef JSD_THREADSAFE
 
 /* the system-wide lock */
 extern JSDStaticLock* _jsd_global_lock;
 #define JSD_LOCK()                               \
     JS_BEGIN_MACRO                               \
         if(!_jsd_global_lock)                    \
             _jsd_global_lock = jsd_CreateLock(); \
-        JS_ASSERT(_jsd_global_lock);             \
+        MOZ_ASSERT(_jsd_global_lock);            \
         jsd_Lock(_jsd_global_lock);              \
     JS_END_MACRO
 
 #define JSD_UNLOCK()                             \
     JS_BEGIN_MACRO                               \
-        JS_ASSERT(_jsd_global_lock);             \
+        MOZ_ASSERT(_jsd_global_lock);            \
         jsd_Unlock(_jsd_global_lock);            \
     JS_END_MACRO
 
 /* locks for the subsystems of a given context */
 #define JSD_INIT_LOCKS(jsdc)                                       \
     ( (nullptr != (jsdc->scriptsLock      = jsd_CreateLock())) &&  \
       (nullptr != (jsdc->sourceTextLock   = jsd_CreateLock())) &&  \
       (nullptr != (jsdc->atomsLock        = jsd_CreateLock())) &&  \
--- a/js/jsd/jsd_atom.cpp
+++ b/js/jsd/jsd_atom.cpp
@@ -34,19 +34,19 @@ static void
     jsd_DropAtom(jsdc, atom3);
     jsd_DropAtom(jsdc, atom4);
 }        
 #endif    
 
 static int
 _atom_smasher(JSHashEntry *he, int i, void *arg)
 {
-    JS_ASSERT(he);
-    JS_ASSERT(he->value);
-    JS_ASSERT(((JSDAtom*)(he->value))->str);
+    MOZ_ASSERT(he);
+    MOZ_ASSERT(he->value);
+    MOZ_ASSERT(((JSDAtom*)(he->value))->str);
 
     free(((JSDAtom*)(he->value))->str);
     free(he->value);
     he->value = nullptr;
     he->key   = nullptr;
     return HT_ENUMERATE_NEXT;
 }
 
@@ -88,17 +88,17 @@ jsd_DestroyAtomTable(JSDContext* jsdc)
 
 JSDAtom*
 jsd_AddAtom(JSDContext* jsdc, const char* str)
 {
     JSDAtom* atom;
 
     if(!str)
     {
-        JS_ASSERT(0);
+        MOZ_ASSERT(0);
         return nullptr;
     }
 
     JSD_LOCK_ATOMS(jsdc);
     
     atom = (JSDAtom*) JS_HashTableLookup(jsdc->atoms, str);
 
     if( atom )
--- a/js/jsd/jsd_high.cpp
+++ b/js/jsd/jsd_high.cpp
@@ -29,19 +29,19 @@ static void* _dangerousThread = nullptr;
 
 #ifdef JSD_THREADSAFE
 JSDStaticLock* _jsd_global_lock = nullptr;
 #endif
 
 #ifdef DEBUG
 void JSD_ASSERT_VALID_CONTEXT(JSDContext* jsdc)
 {
-    JS_ASSERT(jsdc->inited);
-    JS_ASSERT(jsdc->jsrt);
-    JS_ASSERT(jsdc->glob);
+    MOZ_ASSERT(jsdc->inited);
+    MOZ_ASSERT(jsdc->jsrt);
+    MOZ_ASSERT(jsdc->glob);
 }
 #endif
 
 /***************************************************************************/
 /* xpconnect related utility functions implemented in jsd_xpc.cpp */
 
 extern void
 global_finalize(JSFreeOp* fop, JSObject* obj);
@@ -204,18 +204,18 @@ jsd_DebuggerOnForUser(JSRuntime*        
     if( jsdc->userCallbacks.setContext )
         jsdc->userCallbacks.setContext(jsdc, jsdc->user);
     return jsdc;
 }
 
 JSDContext*
 jsd_DebuggerOn(void)
 {
-    JS_ASSERT(_jsrt);
-    JS_ASSERT(_validateUserCallbacks(&_callbacks));
+    MOZ_ASSERT(_jsrt);
+    MOZ_ASSERT(_validateUserCallbacks(&_callbacks));
     return jsd_DebuggerOnForUser(_jsrt, &_callbacks, _user, nullptr);
 }
 
 void
 jsd_DebuggerOff(JSDContext* jsdc)
 {
     jsd_DebuggerPause(jsdc, true);
     /* clear hooks here */
@@ -332,17 +332,17 @@ jsd_DebugErrorHook(JSContext *cx, const 
                    JSErrorReport *report, void *closure)
 {
     JSDContext* jsdc = (JSDContext*) closure;
     JSD_ErrorReporter errorReporter;
     void*             errorReporterData;
     
     if( ! jsdc )
     {
-        JS_ASSERT(0);
+        MOZ_ASSERT(0);
         return true;
     }
     if( JSD_IS_DANGEROUS_THREAD(jsdc) )
         return true;
 
     /* local in case hook gets cleared on another thread */
     JSD_LOCK();
     errorReporter     = jsdc->errorReporter;
@@ -375,17 +375,17 @@ jsd_DebugErrorHook(JSContext *cx, const 
             /* XXX Should make this dependent on ExecutionHook retval */
             return true;
         }
         case JSD_ERROR_REPORTER_CLEAR_RETURN:
             if(report && JSREPORT_IS_EXCEPTION(report->flags))
                 JS_ClearPendingException(cx);
             return false;
         default:
-            JS_ASSERT(0);
+            MOZ_ASSERT(0);
             break;
     }
     return true;
 }
 
 bool
 jsd_SetErrorReporter(JSDContext*       jsdc, 
                      JSD_ErrorReporter reporter, 
--- a/js/jsd/jsd_hook.cpp
+++ b/js/jsd/jsd_hook.cpp
@@ -154,20 +154,20 @@ jsd_CallExecutionHook(JSDContext* jsdc,
         case JSD_HOOK_RETURN_RET_WITH_VAL:
             return JSTRAP_RETURN;
         case JSD_HOOK_RETURN_THROW_WITH_VAL:
             return JSTRAP_THROW;
         case JSD_HOOK_RETURN_CONTINUE:
             break;
         case JSD_HOOK_RETURN_CONTINUE_THROW:
             /* only makes sense for jsd_ThrowHandler (which init'd rval) */
-            JS_ASSERT(JSD_HOOK_THROW == type);
+            MOZ_ASSERT(JSD_HOOK_THROW == type);
             return JSTRAP_THROW;
         default:
-            JS_ASSERT(0);
+            MOZ_ASSERT(0);
             break;
     }
     return JSTRAP_CONTINUE;
 }
 
 bool
 jsd_CallCallHook (JSDContext* jsdc,
                   JSContext *cx,
--- a/js/jsd/jsd_lock.cpp
+++ b/js/jsd/jsd_lock.cpp
@@ -53,34 +53,34 @@ struct JSDStaticLock
 #undef _CURRENT_THREAD
 #ifdef JSD_ATTACH_THREAD_HACK
 #define _CURRENT_THREAD(out)                                                  \
 JS_BEGIN_MACRO                                                                \
     out = (void*) PR_GetCurrentThread();                                      \
     if(!out)                                                                  \
         out = (void*) JS_AttachThread(PR_USER_THREAD, PR_PRIORITY_NORMAL,     \
                                       nullptr);                               \
-    JS_ASSERT(out);                                                           \
+    MOZ_ASSERT(out);                                                          \
 JS_END_MACRO
 #else
 #define _CURRENT_THREAD(out)             \
 JS_BEGIN_MACRO                           \
     out = (void*) PR_GetCurrentThread(); \
-    JS_ASSERT(out);                      \
+    MOZ_ASSERT(out);                     \
 JS_END_MACRO
 #endif
 
 #ifdef DEBUG
 #define JSD_LOCK_SIG 0x10CC10CC
 void ASSERT_VALID_LOCK(JSDStaticLock* lock)
 {
-    JS_ASSERT(lock);
-    JS_ASSERT(lock->lock);
-    JS_ASSERT(lock->count >= 0);
-    JS_ASSERT(lock->sig == (uint16_t) JSD_LOCK_SIG);
+    MOZ_ASSERT(lock);
+    MOZ_ASSERT(lock->lock);
+    MOZ_ASSERT(lock->count >= 0);
+    MOZ_ASSERT(lock->sig == (uint16_t) JSD_LOCK_SIG);
 }    
 #else
 #define ASSERT_VALID_LOCK(x) ((void)0)
 #endif
 
 JSDStaticLock*
 jsd_CreateLock()
 {
@@ -106,37 +106,37 @@ jsd_Lock(JSDStaticLock* lock)
 {
     void* me;
     ASSERT_VALID_LOCK(lock);
     _CURRENT_THREAD(me);
 
     if(lock->owner == me)
     {
         lock->count++;
-        JS_ASSERT(lock->count > 1);
+        MOZ_ASSERT(lock->count > 1);
     }
     else
     {
         PR_Lock(lock->lock);            /* this can block... */
-        JS_ASSERT(lock->owner == 0);
-        JS_ASSERT(lock->count == 0);
+        MOZ_ASSERT(lock->owner == 0);
+        MOZ_ASSERT(lock->count == 0);
         lock->count = 1;
         lock->owner = me;
     }
 }    
 
 void
 jsd_Unlock(JSDStaticLock* lock)
 {
     void* me;
     ASSERT_VALID_LOCK(lock);
     _CURRENT_THREAD(me);
 
     /* it's an error to unlock a lock you don't own */
-    JS_ASSERT(lock->owner == me);
+    MOZ_ASSERT(lock->owner == me);
     if(lock->owner != me)
         return;
 
     if(--lock->count == 0)
     {
         lock->owner = nullptr;
         PR_Unlock(lock->lock);
     }
@@ -146,17 +146,17 @@ jsd_Unlock(JSDStaticLock* lock)
 bool
 jsd_IsLocked(JSDStaticLock* lock)
 {
     void* me;
     ASSERT_VALID_LOCK(lock);
     _CURRENT_THREAD(me);
     if (lock->owner != me)
         return false;
-    JS_ASSERT(lock->count > 0);
+    MOZ_ASSERT(lock->count > 0);
     return true;
 }    
 #endif /* DEBUG */
 
 void*
 jsd_CurrentThread()
 {
     void* me;
--- a/js/jsd/jsd_obj.cpp
+++ b/js/jsd/jsd_obj.cpp
@@ -50,27 +50,27 @@ static void
 }
 #else
 #define TRACEOBJ(jsdc, jsdobj, which) ((void)0)
 #endif /* JSD_TRACE */
 
 #ifdef DEBUG
 void JSD_ASSERT_VALID_OBJECT(JSDObject* jsdobj)
 {
-    JS_ASSERT(jsdobj);
-    JS_ASSERT(!JS_CLIST_IS_EMPTY(&jsdobj->links));
-    JS_ASSERT(jsdobj->obj);
+    MOZ_ASSERT(jsdobj);
+    MOZ_ASSERT(!JS_CLIST_IS_EMPTY(&jsdobj->links));
+    MOZ_ASSERT(jsdobj->obj);
 }
 #endif
 
 
 static void
 _destroyJSDObject(JSDContext* jsdc, JSDObject* jsdobj)
 {
-    JS_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
+    MOZ_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
 
     JS_REMOVE_LINK(&jsdobj->links);
     JS_HashTableRemove(jsdc->objectsTable, jsdobj->obj);
 
     if(jsdobj->newURL)
         jsd_DropAtom(jsdc, jsdobj->newURL);
     if(jsdobj->ctorURL)
         jsd_DropAtom(jsdc, jsdobj->ctorURL);
@@ -151,17 +151,17 @@ jsd_DestroyObjects(JSDContext* jsdc)
     JSD_UNLOCK_OBJECTS(jsdc);
 }
 
 JSDObject*
 jsd_IterateObjects(JSDContext* jsdc, JSDObject** iterp)
 {
     JSDObject *jsdobj = *iterp;
 
-    JS_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
+    MOZ_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
 
     if( !jsdobj )
         jsdobj = (JSDObject *)jsdc->objectsList.next;
     if( jsdobj == (JSDObject *)&jsdc->objectsList )
         return nullptr;
     *iterp = (JSDObject*) jsdobj->links.next;
     return jsdobj;
 }
--- a/js/jsd/jsd_scpt.cpp
+++ b/js/jsd/jsd_scpt.cpp
@@ -23,40 +23,40 @@ using mozilla::AutoSafeJSContext;
 
 #define NOT_SET_YET -1
 
 /***************************************************************************/
 
 #ifdef DEBUG
 void JSD_ASSERT_VALID_SCRIPT(JSDScript* jsdscript)
 {
-    JS_ASSERT(jsdscript);
-    JS_ASSERT(jsdscript->script);
+    MOZ_ASSERT(jsdscript);
+    MOZ_ASSERT(jsdscript->script);
 }
 void JSD_ASSERT_VALID_EXEC_HOOK(JSDExecHook* jsdhook)
 {
-    JS_ASSERT(jsdhook);
-    JS_ASSERT(jsdhook->hook);
+    MOZ_ASSERT(jsdhook);
+    MOZ_ASSERT(jsdhook->hook);
 }
 #endif
 
 static JSDScript*
 _newJSDScript(JSDContext*  jsdc,
               JSContext    *cx,
               JSScript     *script_)
 {
     JS::RootedScript script(cx, script_);
     if ( JS_GetScriptIsSelfHosted(script) )
         return nullptr;
 
     JSDScript*  jsdscript;
     unsigned     lineno;
     const char* raw_filename;
 
-    JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
+    MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
 
     /* these are inlined javascript: urls and we can't handle them now */
     lineno = (unsigned) JS_GetScriptBaseLineNumber(cx, script);
     if( lineno == 0 )
         return nullptr;
 
     jsdscript = (JSDScript*) calloc(1, sizeof(JSDScript));
     if( ! jsdscript )
@@ -77,17 +77,17 @@ static JSDScript*
     
     return jsdscript;
 }           
 
 static void 
 _destroyJSDScript(JSDContext*  jsdc,
                   JSDScript*   jsdscript)
 {
-    JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
+    MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
 
     /* destroy all hooks */
     jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript);
 
     JS_REMOVE_LINK(&jsdscript->links);
     if(jsdscript->url)
         free(jsdscript->url);
 
@@ -125,17 +125,17 @@ static void
     n = size_t(snprintf(Buf, sizeof(Buf), "%sscript=%08X, %s, ",
                         leadingtext, (unsigned) jsdscript->script,
                         name ? name : "no URL"));
     if (n + 1 < sizeof(Buf)) {
         if (fun) {
             n += size_t(snprintf(Buf + n, sizeof(Buf) - n, "%s", "no fun"));
         } else {
             n += JS_PutEscapedFlatString(Buf + n, sizeof(Buf) - n,
-                                         JS_ASSERT_STRING_IS_FLAT(fun), 0);
+                                         MOZ_ASSERT_STRING_IS_FLAT(fun), 0);
             Buf[sizeof(Buf) - 1] = '\0';
         }
         if (n + 1 < sizeof(Buf))
             snprintf(Buf + n, sizeof(Buf) - n, ", %d-%d\n", base, base + extent - 1);
     }
     OutputDebugString( Buf );
 }
 
@@ -213,29 +213,29 @@ jsd_DestroyScriptManager(JSDContext* jsd
         JS_HashTableDestroy(jsdc->scriptsTable);
     JSD_UNLOCK_SCRIPTS(jsdc);
 }
 
 JSDScript*
 jsd_FindJSDScript( JSDContext*  jsdc,
                    JSScript     *script )
 {
-    JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
+    MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
     return (JSDScript*) JS_HashTableLookup(jsdc->scriptsTable, (void *)script);
 }
 
 JSDScript *
 jsd_FindOrCreateJSDScript(JSDContext    *jsdc,
                           JSContext     *cx,
                           JSScript      *script_,
                           JSAbstractFramePtr frame)
 {
     JS::RootedScript script(cx, script_);
     JSDScript *jsdscript;
-    JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
+    MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
 
     jsdscript = jsd_FindJSDScript(jsdc, script);
     if (jsdscript)
         return jsdscript;
 
     /* Fallback for unknown scripts: create a new script. */
     if (!frame) {
         JSBrokenFrameIterator iter(cx);
@@ -364,17 +364,17 @@ jsd_GetJSFunction (JSDContext *jsdc, JSD
     return JS_GetScriptFunction(cx, script->script);
 }
 
 JSDScript*
 jsd_IterateScripts(JSDContext* jsdc, JSDScript **iterp)
 {
     JSDScript *jsdscript = *iterp;
     
-    JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
+    MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
 
     if( !jsdscript )
         jsdscript = (JSDScript *)jsdc->scripts.next;
     if( jsdscript == (JSDScript *)&jsdc->scripts )
         return nullptr;
     *iterp = (JSDScript*) jsdscript->links.next;
     return jsdscript;
 }
@@ -393,17 +393,17 @@ jsd_GetScriptPrivate(JSDScript *jsdscrip
     return jsdscript->data;
 }
 
 bool
 jsd_IsActiveScript(JSDContext* jsdc, JSDScript *jsdscript)
 {
     JSDScript *current;
 
-    JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
+    MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
 
     for( current = (JSDScript *)jsdc->scripts.next;
          current != (JSDScript *)&jsdc->scripts;
          current = (JSDScript *)current->links.next )
     {
         if(jsdscript == current)
             return true;
     }
@@ -715,19 +715,19 @@ jsd_TrapHandler(JSContext *cx, JSScript 
     if( nullptr == (jsdc = jsd_JSDContextForJSContext(cx)) ||
         ! _isActiveHook(jsdc, script, jsdhook) )
     {
         JSD_UNLOCK();
         return JSTRAP_CONTINUE;
     }
 
     JSD_ASSERT_VALID_EXEC_HOOK(jsdhook);
-    JS_ASSERT(!jsdhook->pc || jsdhook->pc == (uintptr_t)pc);
-    JS_ASSERT(jsdhook->jsdscript->script == script);
-    JS_ASSERT(jsdhook->jsdscript->jsdc == jsdc);
+    MOZ_ASSERT(!jsdhook->pc || jsdhook->pc == (uintptr_t)pc);
+    MOZ_ASSERT(jsdhook->jsdscript->script == script);
+    MOZ_ASSERT(jsdhook->jsdscript->jsdc == jsdc);
 
     hook = jsdhook->hook;
     hookData = jsdhook->callerdata;
 
     /* do not use jsdhook-> after this point */
     JSD_UNLOCK();
 
     if( ! jsdc || ! jsdc->inited )
--- a/js/jsd/jsd_stak.cpp
+++ b/js/jsd/jsd_stak.cpp
@@ -12,24 +12,24 @@
 #include "jsfriendapi.h"
 #include "nsCxPusher.h"
 
 using mozilla::AutoPushJSContext;
 
 #ifdef DEBUG
 void JSD_ASSERT_VALID_THREAD_STATE(JSDThreadState* jsdthreadstate)
 {
-    JS_ASSERT(jsdthreadstate);
-    JS_ASSERT(jsdthreadstate->stackDepth > 0);
+    MOZ_ASSERT(jsdthreadstate);
+    MOZ_ASSERT(jsdthreadstate->stackDepth > 0);
 }
 
 void JSD_ASSERT_VALID_STACK_FRAME(JSDStackFrameInfo* jsdframe)
 {
-    JS_ASSERT(jsdframe);
-    JS_ASSERT(jsdframe->jsdthreadstate);
+    MOZ_ASSERT(jsdframe);
+    MOZ_ASSERT(jsdframe->jsdthreadstate);
 }
 #endif
 
 static JSDStackFrameInfo* 
 _addNewFrame(JSDContext*        jsdc,
              JSDThreadState*    jsdthreadstate,
              JSScript*          script,
              uintptr_t          pc,
@@ -143,18 +143,18 @@ jsd_NewThreadState(JSDContext* jsdc, JSC
 }
 
 void
 jsd_DestroyThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
 {
     JSDStackFrameInfo* jsdframe;
     JSCList* list;
 
-    JS_ASSERT(jsdthreadstate);
-    JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
+    MOZ_ASSERT(jsdthreadstate);
+    MOZ_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
 
     JSD_LOCK_THREADSTATES(jsdc);
     JS_REMOVE_LINK(&jsdthreadstate->links);
     JSD_UNLOCK_THREADSTATES(jsdc);
 
     list = &jsdthreadstate->stack;
     while( (JSDStackFrameInfo*)list != (jsdframe = (JSDStackFrameInfo*)list->next) )
     {
@@ -397,27 +397,27 @@ jsd_EvaluateUCScriptInStackFrame(JSDCont
                                  const jschar *bytes, unsigned length,
                                  const char *filename, unsigned lineno,
                                  bool eatExceptions, JS::MutableHandleValue rval)
 {
     bool retval;
     bool valid;
     JSExceptionState* exceptionState = nullptr;
 
-    JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
+    MOZ_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
 
     JSD_LOCK_THREADSTATES(jsdc);
     valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
     JSD_UNLOCK_THREADSTATES(jsdc);
 
     if( ! valid )
         return false;
 
     AutoPushJSContext cx(jsdthreadstate->context);
-    JS_ASSERT(cx);
+    MOZ_ASSERT(cx);
 
     if (eatExceptions)
         exceptionState = JS_SaveExceptionState(cx);
     JS_ClearPendingException(cx);
     jsd_StartingEvalUsingFilename(jsdc, filename);
     retval = jsdframe->frame.evaluateUCInStackFrame(cx, bytes, length, filename, lineno,
                                                     rval);
     jsd_FinishedEvalUsingFilename(jsdc, filename);
@@ -434,27 +434,27 @@ jsd_EvaluateScriptInStackFrame(JSDContex
                                const char *bytes, unsigned length,
                                const char *filename, unsigned lineno,
                                bool eatExceptions, JS::MutableHandleValue rval)
 {
     bool retval;
     bool valid;
     JSExceptionState* exceptionState = nullptr;
 
-    JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
+    MOZ_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
 
     JSD_LOCK_THREADSTATES(jsdc);
     valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
     JSD_UNLOCK_THREADSTATES(jsdc);
 
     if (!valid)
         return false;
 
     AutoPushJSContext cx(jsdthreadstate->context);
-    JS_ASSERT(cx);
+    MOZ_ASSERT(cx);
 
     if (eatExceptions)
         exceptionState = JS_SaveExceptionState(cx);
     JS_ClearPendingException(cx);
     jsd_StartingEvalUsingFilename(jsdc, filename);
     retval = jsdframe->frame.evaluateInStackFrame(cx, bytes, length, filename, lineno,
                                                   rval);
     jsd_FinishedEvalUsingFilename(jsdc, filename);
@@ -478,50 +478,50 @@ jsd_ValToStringInStackFrame(JSDContext* 
     JSD_LOCK_THREADSTATES(jsdc);
     valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
     JSD_UNLOCK_THREADSTATES(jsdc);
 
     if( ! valid )
         return nullptr;
 
     cx = jsdthreadstate->context;
-    JS_ASSERT(cx);
+    MOZ_ASSERT(cx);
 
     JS::RootedValue v(cx, val);
     exceptionState = JS_SaveExceptionState(cx);
     retval = JS::ToString(cx, v);
     JS_RestoreExceptionState(cx, exceptionState);
 
     return retval;
 }
 
 bool
 jsd_IsValidThreadState(JSDContext*        jsdc, 
                        JSDThreadState*    jsdthreadstate)
 {
     JSDThreadState *cur;
 
-    JS_ASSERT( JSD_THREADSTATES_LOCKED(jsdc) );
+    MOZ_ASSERT( JSD_THREADSTATES_LOCKED(jsdc) );
 
     for( cur = (JSDThreadState*)jsdc->threadsStates.next;
          cur != (JSDThreadState*)&jsdc->threadsStates;
          cur = (JSDThreadState*)cur->links.next ) 
     {
         if( cur == jsdthreadstate )
             return true;
     }
     return false;
 }    
 
 bool
 jsd_IsValidFrameInThreadState(JSDContext*        jsdc, 
                               JSDThreadState*    jsdthreadstate,
                               JSDStackFrameInfo* jsdframe)
 {
-    JS_ASSERT(JSD_THREADSTATES_LOCKED(jsdc));
+    MOZ_ASSERT(JSD_THREADSTATES_LOCKED(jsdc));
 
     if( ! jsd_IsValidThreadState(jsdc, jsdthreadstate) )
         return false;
     if( jsdframe->jsdthreadstate != jsdthreadstate )
         return false;
 
     JSD_ASSERT_VALID_THREAD_STATE(jsdthreadstate);
     JSD_ASSERT_VALID_STACK_FRAME(jsdframe);
--- a/js/jsd/jsd_step.cpp
+++ b/js/jsd/jsd_step.cpp
@@ -67,17 +67,17 @@ static void
         printf("%s this: ", isConstructing ? "constructing":"");
 
         if (JS_GetFrameThis(cx, frame, &thisVal))
             printf("0x%0llx", (uintptr_t) thisVal);
         else
             puts("<unavailable>");
     }
     printf("\n");
-    JS_ASSERT(indent >= 0);
+    MOZ_ASSERT(indent >= 0);
 }
 #endif
 
 bool
 _callHook(JSDContext *jsdc, JSContext *cx, JSAbstractFramePtr frame, bool isConstructing,
           bool before, unsigned type, JSD_CallHookProc hook, void *hookData)
 {
     JSDScript*        jsdscript;
--- a/js/jsd/jsd_text.cpp
+++ b/js/jsd/jsd_text.cpp
@@ -10,18 +10,18 @@
 
 #include <ctype.h>
 #include "jsd.h"
 #include "jsprf.h"
 
 #ifdef DEBUG
 void JSD_ASSERT_VALID_SOURCE_TEXT(JSDSourceText* jsdsrc)
 {
-    JS_ASSERT(jsdsrc);
-    JS_ASSERT(jsdsrc->url);
+    MOZ_ASSERT(jsdsrc);
+    MOZ_ASSERT(jsdsrc->url);
 }
 #endif
 
 /***************************************************************************/
 /* XXX add notification */
 
 static void
 _clearText(JSDContext* jsdc, JSDSourceText* jsdsrc)
@@ -93,17 +93,17 @@ static JSDSourceText*
     jsdsrc->alterCount = jsdc->sourceAlterCount++ ;
             
     return jsdsrc;
 }
 
 static void
 _destroySource(JSDContext* jsdc, JSDSourceText* jsdsrc)
 {
-    JS_ASSERT(nullptr == jsdsrc->text);  /* must _clearText() first */
+    MOZ_ASSERT(nullptr == jsdsrc->text);  /* must _clearText() first */
     free(jsdsrc->url);
     free(jsdsrc);
 }
 
 static void
 _removeSource(JSDContext* jsdc, JSDSourceText* jsdsrc)
 {
     JS_REMOVE_LINK(&jsdsrc->links);
@@ -486,17 +486,17 @@ jsd_StartingEvalUsingFilename(JSDContext
     /* NOTE: We leave it locked! */
     JSD_LOCK_SOURCE_TEXT(jsdc); 
 
     jsdsrc = jsd_FindSourceForURL(jsdc, url);
     if(jsdsrc)
     {
 #if 0
 #ifndef JSD_LOWLEVEL_SOURCE
-        JS_ASSERT(! jsdsrc->doingEval);
+        MOZ_ASSERT(! jsdsrc->doingEval);
 #endif
 #endif
         jsdsrc->doingEval = true;
     }
 }    
 
 void
 jsd_FinishedEvalUsingFilename(JSDContext* jsdc, const char* url)
@@ -510,16 +510,16 @@ jsd_FinishedEvalUsingFilename(JSDContext
     {
 #if 0
 #ifndef JSD_LOWLEVEL_SOURCE
         /*
         * when using this low level source addition, this jsdsrc might 
         * not have existed before the eval, but does exist now (without
         * this flag set!)
         */
-        JS_ASSERT(jsdsrc->doingEval);
+        MOZ_ASSERT(jsdsrc->doingEval);
 #endif
 #endif
         jsdsrc->doingEval = false;
     }
 
     JSD_UNLOCK_SOURCE_TEXT(jsdc);
 }    
--- a/js/jsd/jsd_val.cpp
+++ b/js/jsd/jsd_val.cpp
@@ -14,50 +14,50 @@
 #include "jswrapper.h"
 #include "nsCxPusher.h"
 
 using mozilla::AutoSafeJSContext;
 
 #ifdef DEBUG
 void JSD_ASSERT_VALID_VALUE(JSDValue* jsdval)
 {
-    JS_ASSERT(jsdval);
-    JS_ASSERT(jsdval->nref > 0);
+    MOZ_ASSERT(jsdval);
+    MOZ_ASSERT(jsdval->nref > 0);
     if(!JS_CLIST_IS_EMPTY(&jsdval->props))
     {
-        JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS));
-        JS_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
+        MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS));
+        MOZ_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
     }
 
     if(jsdval->proto)
     {
-        JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROTO));
-        JS_ASSERT(jsdval->proto->nref > 0);
+        MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROTO));
+        MOZ_ASSERT(jsdval->proto->nref > 0);
     }
     if(jsdval->parent)
     {
-        JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PARENT));
-        JS_ASSERT(jsdval->parent->nref > 0);
+        MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PARENT));
+        MOZ_ASSERT(jsdval->parent->nref > 0);
     }
     if(jsdval->ctor)
     {
-        JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_CTOR));
-        JS_ASSERT(jsdval->ctor->nref > 0);
+        MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_CTOR));
+        MOZ_ASSERT(jsdval->ctor->nref > 0);
     }
 }
 
 void JSD_ASSERT_VALID_PROPERTY(JSDProperty* jsdprop)
 {
-    JS_ASSERT(jsdprop);
-    JS_ASSERT(jsdprop->name);
-    JS_ASSERT(jsdprop->name->nref > 0);
-    JS_ASSERT(jsdprop->val);
-    JS_ASSERT(jsdprop->val->nref > 0);
+    MOZ_ASSERT(jsdprop);
+    MOZ_ASSERT(jsdprop->name);
+    MOZ_ASSERT(jsdprop->name->nref > 0);
+    MOZ_ASSERT(jsdprop->val);
+    MOZ_ASSERT(jsdprop->val->nref > 0);
     if(jsdprop->alias)
-        JS_ASSERT(jsdprop->alias->nref > 0);
+        MOZ_ASSERT(jsdprop->alias->nref > 0);
 }
 #endif
 
 
 bool
 jsd_IsValueObject(JSDContext* jsdc, JSDValue* jsdval)
 {
     return !JSVAL_IS_PRIMITIVE(jsdval->val) || JSVAL_IS_NULL(jsdval->val);
@@ -128,17 +128,17 @@ jsd_IsValueNative(JSDContext* jsdc, JSDV
     if(jsd_IsValueFunction(jsdc, jsdval))
     {
         JSAutoCompartment ac(cx, JSVAL_TO_OBJECT(jsdval->val));
         AutoSaveExceptionState as(cx);
         bool ok = false;
         fun = JSD_GetValueFunction(jsdc, jsdval);
         if(fun)
             ok = JS_GetFunctionScript(cx, fun) ? false : true;
-        JS_ASSERT(fun);
+        MOZ_ASSERT(fun);
         return ok;
     }
     return !JSVAL_IS_PRIMITIVE(jsdval->val);
 }
 
 /***************************************************************************/
 
 bool
@@ -270,17 +270,17 @@ jsd_NewValue(JSDContext* jsdc, jsval val
     JS_INIT_CLIST(&jsdval->props);
 
     return jsdval;
 }
 
 void
 jsd_DropValue(JSDContext* jsdc, JSDValue* jsdval)
 {
-    JS_ASSERT(jsdval->nref > 0);
+    MOZ_ASSERT(jsdval->nref > 0);
     if(0 == --jsdval->nref)
     {
         jsd_RefreshValue(jsdc, jsdval);
         if(JSVAL_IS_GCTHING(jsdval->val))
         {
             AutoSafeJSContext cx;
             JSAutoCompartment ac(cx, jsdc->glob);
             JS_RemoveValueRoot(cx, &jsdval->val);
@@ -344,30 +344,30 @@ static void _freeProps(JSDContext* jsdc,
     JSDProperty* jsdprop;
 
     while(jsdprop = (JSDProperty*)jsdval->props.next,
           jsdprop != (JSDProperty*)&jsdval->props)
     {
         JS_REMOVE_AND_INIT_LINK(&jsdprop->links);
         jsd_DropProperty(jsdc, jsdprop);
     }
-    JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
+    MOZ_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
     CLEAR_BIT_FLAG(jsdval->flags, GOT_PROPS);
 }
 
 static bool _buildProps(JSDContext* jsdc, JSDValue* jsdval)
 {
     AutoSafeJSContext cx;
     JS::RootedObject obj(cx);
     JSPropertyDescArray pda;
     unsigned i;
 
-    JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
-    JS_ASSERT(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)));
-    JS_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
+    MOZ_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
+    MOZ_ASSERT(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)));
+    MOZ_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
 
     if(JSVAL_IS_PRIMITIVE(jsdval->val))
         return false;
 
     obj = JSVAL_TO_OBJECT(jsdval->val);
 
     JSAutoCompartment ac(cx, obj);
 
@@ -448,28 +448,28 @@ jsd_GetCountOfProperties(JSDContext* jsd
 }
 
 JSDProperty*
 jsd_IterateProperties(JSDContext* jsdc, JSDValue* jsdval, JSDProperty **iterp)
 {
     JSDProperty* jsdprop = *iterp;
     if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)))
     {
-        JS_ASSERT(!jsdprop);
+        MOZ_ASSERT(!jsdprop);
         if(!_buildProps(jsdc, jsdval))
             return nullptr;
     }
 
     if(!jsdprop)
         jsdprop = (JSDProperty*)jsdval->props.next;
     if(jsdprop == (JSDProperty*)&jsdval->props)
         return nullptr;
     *iterp = (JSDProperty*)jsdprop->links.next;
 
-    JS_ASSERT(jsdprop);
+    MOZ_ASSERT(jsdprop);
     jsdprop->nref++;
     return jsdprop;
 }
 
 JSDProperty*
 jsd_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* nameStr)
 {
     JS::RootedString name(jsdc->jsrt, nameStr);
@@ -581,17 +581,17 @@ jsd_GetValueFunction(JSDContext* jsdc, J
 JSDValue*
 jsd_GetValuePrototype(JSDContext* jsdc, JSDValue* jsdval)
 {
     AutoSafeJSContext cx;
     if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROTO)))
     {
         JS::RootedObject obj(cx);
         JS::RootedObject proto(cx);
-        JS_ASSERT(!jsdval->proto);
+        MOZ_ASSERT(!jsdval->proto);
         SET_BIT_FLAG(jsdval->flags, GOT_PROTO);
         if(JSVAL_IS_PRIMITIVE(jsdval->val))
             return nullptr;
         obj = JSVAL_TO_OBJECT(jsdval->val);
         if(!JS_GetPrototype(cx, obj, &proto))
             return nullptr;
         if(!proto)
             return nullptr;
@@ -605,17 +605,17 @@ jsd_GetValuePrototype(JSDContext* jsdc, 
 JSDValue*
 jsd_GetValueParent(JSDContext* jsdc, JSDValue* jsdval)
 {
     if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PARENT)))
     {
         AutoSafeJSContext cx;
         JS::RootedObject obj(cx);
         JS::RootedObject parent(cx);
-        JS_ASSERT(!jsdval->parent);
+        MOZ_ASSERT(!jsdval->parent);
         SET_BIT_FLAG(jsdval->flags, GOT_PARENT);
         if(JSVAL_IS_PRIMITIVE(jsdval->val))
             return nullptr;
         obj = JSVAL_TO_OBJECT(jsdval->val);
         {
             JSAutoCompartment ac(cx, obj);
             parent = JS_GetParentOrScopeChain(cx, obj);
         }
@@ -632,17 +632,17 @@ JSDValue*
 jsd_GetValueConstructor(JSDContext* jsdc, JSDValue* jsdval)
 {
     if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_CTOR)))
     {
         AutoSafeJSContext cx;
         JS::RootedObject obj(cx);
         JS::RootedObject proto(cx);
         JS::RootedObject ctor(cx);
-        JS_ASSERT(!jsdval->ctor);
+        MOZ_ASSERT(!jsdval->ctor);
         SET_BIT_FLAG(jsdval->flags, GOT_CTOR);
         if(JSVAL_IS_PRIMITIVE(jsdval->val))
             return nullptr;
         obj = JSVAL_TO_OBJECT(jsdval->val);
         if(!JS_GetPrototype(cx, obj, &proto))
             return nullptr;
         if(!proto)
             return nullptr;
@@ -732,18 +732,18 @@ unsigned
 jsd_GetPropertyFlags(JSDContext* jsdc, JSDProperty* jsdprop)
 {
     return jsdprop->flags;
 }
 
 void
 jsd_DropProperty(JSDContext* jsdc, JSDProperty* jsdprop)
 {
-    JS_ASSERT(jsdprop->nref > 0);
+    MOZ_ASSERT(jsdprop->nref > 0);
     if(0 == --jsdprop->nref)
     {
-        JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdprop->links));
+        MOZ_ASSERT(JS_CLIST_IS_EMPTY(&jsdprop->links));
         DROP_CLEAR_VALUE(jsdc, jsdprop->val);
         DROP_CLEAR_VALUE(jsdc, jsdprop->name);
         DROP_CLEAR_VALUE(jsdc, jsdprop->alias);
         free(jsdprop);
     }
 }
--- a/js/jsd/jsdebug.cpp
+++ b/js/jsd/jsdebug.cpp
@@ -385,17 +385,17 @@ JSD_IterateSources(JSDContext* jsdc, JSD
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     return jsd_IterateSources(jsdc, iterp);
 }
 
 JSD_PUBLIC_API(JSDSourceText*)
 JSD_FindSourceForURL(JSDContext* jsdc, const char* url)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
-    JS_ASSERT(url);
+    MOZ_ASSERT(url);
     return jsd_FindSourceForURL(jsdc, url);
 }
 
 JSD_PUBLIC_API(const char*)
 JSD_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
@@ -403,18 +403,18 @@ JSD_GetSourceURL(JSDContext* jsdc, JSDSo
 }
 
 JSD_PUBLIC_API(bool)
 JSD_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc,
                   const char** ppBuf, int* pLen)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
-    JS_ASSERT(ppBuf);
-    JS_ASSERT(pLen);
+    MOZ_ASSERT(ppBuf);
+    MOZ_ASSERT(pLen);
     return jsd_GetSourceText(jsdc, jsdsrc, ppBuf, pLen);
 }
 
 JSD_PUBLIC_API(void)
 JSD_ClearSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
@@ -468,17 +468,17 @@ JSD_DestroyAllSources( JSDContext* jsdc 
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     jsd_DestroyAllSources(jsdc);
 }
 
 JSD_PUBLIC_API(JSDSourceText*)
 JSD_NewSourceText(JSDContext* jsdc, const char* url)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
-    JS_ASSERT(url);
+    MOZ_ASSERT(url);
     return jsd_NewSourceText(jsdc, url);
 }
 
 JSD_PUBLIC_API(JSDSourceText*)
 JSD_AppendSourceText(JSDContext* jsdc,
                      JSDSourceText* jsdsrc,
                      const char* text,       /* *not* zero terminated */
                      size_t length,
@@ -503,17 +503,17 @@ JSD_AppendUCSourceText(JSDContext*     j
 
 JSD_PUBLIC_API(bool)
 JSD_AddFullSourceText(JSDContext* jsdc,
                       const char* text,       /* *not* zero terminated */
                       size_t      length,
                       const char* url)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
-    JS_ASSERT(url);
+    MOZ_ASSERT(url);
     return jsd_AddFullSourceText(jsdc, text, length, url);
 }
 
 /***************************************************************************/
 /* Execution/Interrupt Hook functions */
 
 JSD_PUBLIC_API(bool)
 JSD_SetExecutionHook(JSDContext*           jsdc,
@@ -764,71 +764,71 @@ JSD_IsStackFrameConstructing(JSDContext*
 JSD_PUBLIC_API(bool)
 JSD_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
                                  JSDThreadState* jsdthreadstate,
                                  JSDStackFrameInfo* jsdframe,
                                  const jschar *bytes, unsigned length,
                                  const char *filename, unsigned lineno, JS::MutableHandleValue rval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
-    JS_ASSERT(bytes);
-    JS_ASSERT(length);
-    JS_ASSERT(filename);
+    MOZ_ASSERT(bytes);
+    MOZ_ASSERT(length);
+    MOZ_ASSERT(filename);
 
     return jsd_EvaluateUCScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
                                             bytes, length, filename, lineno,
                                             true, rval);
 }
 
 JSD_PUBLIC_API(bool)
 JSD_AttemptUCScriptInStackFrame(JSDContext* jsdc,
                                 JSDThreadState* jsdthreadstate,
                                 JSDStackFrameInfo* jsdframe,
                                 const jschar *bytes, unsigned length,
                                 const char *filename, unsigned lineno,
                                 JS::MutableHandleValue rval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
-    JS_ASSERT(bytes);
-    JS_ASSERT(length);
-    JS_ASSERT(filename);
+    MOZ_ASSERT(bytes);
+    MOZ_ASSERT(length);
+    MOZ_ASSERT(filename);
 
     return jsd_EvaluateUCScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
                                             bytes, length, filename, lineno,
                                             false, rval);
 }
 
 JSD_PUBLIC_API(bool)
 JSD_EvaluateScriptInStackFrame(JSDContext* jsdc,
                                JSDThreadState* jsdthreadstate,
                                JSDStackFrameInfo* jsdframe,
                                const char *bytes, unsigned length,
                                const char *filename, unsigned lineno, JS::MutableHandleValue rval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
-    JS_ASSERT(bytes);
-    JS_ASSERT(length);
-    JS_ASSERT(filename);
+    MOZ_ASSERT(bytes);
+    MOZ_ASSERT(length);
+    MOZ_ASSERT(filename);
 
     return jsd_EvaluateScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
                                           bytes, length,
                                           filename, lineno, true, rval);
 }
 
 JSD_PUBLIC_API(bool)
 JSD_AttemptScriptInStackFrame(JSDContext* jsdc,
                               JSDThreadState* jsdthreadstate,
                               JSDStackFrameInfo* jsdframe,
                               const char *bytes, unsigned length,
                               const char *filename, unsigned lineno, JS::MutableHandleValue rval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
-    JS_ASSERT(bytes);
-    JS_ASSERT(length);
-    JS_ASSERT(filename);
+    MOZ_ASSERT(bytes);
+    MOZ_ASSERT(length);
+    MOZ_ASSERT(filename);
 
     return jsd_EvaluateScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
                                           bytes, length,
                                           filename, lineno, false, rval);
 }
 
 JSD_PUBLIC_API(JSString*)
 JSD_ValToStringInStackFrame(JSDContext* jsdc,
@@ -1123,26 +1123,26 @@ JSD_GetCountOfProperties(JSDContext* jsd
     return jsd_GetCountOfProperties(jsdc, jsdval);
 }
 
 JSD_PUBLIC_API(JSDProperty*)
 JSD_IterateProperties(JSDContext* jsdc, JSDValue* jsdval, JSDProperty **iterp)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_VALUE(jsdval);
-    JS_ASSERT(iterp);
+    MOZ_ASSERT(iterp);
     return jsd_IterateProperties(jsdc, jsdval, iterp);
 }
 
 JSD_PUBLIC_API(JSDProperty*)
 JSD_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* name)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_VALUE(jsdval);
-    JS_ASSERT(name);
+    MOZ_ASSERT(name);
     return jsd_GetValueProperty(jsdc, jsdval, name);
 }
 
 JSD_PUBLIC_API(JSDValue*)
 JSD_GetValuePrototype(JSDContext* jsdc, JSDValue* jsdval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_VALUE(jsdval);
@@ -1294,17 +1294,17 @@ JSD_GetObjectConstructorName(JSDContext*
     JSD_ASSERT_VALID_OBJECT(jsdobj);
     return jsd_GetObjectConstructorName(jsdc, jsdobj);
 }
 
 JSD_PUBLIC_API(JSDObject*)
 JSD_GetJSDObjectForJSObject(JSDContext* jsdc, JSObject* jsobj)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
-    JS_ASSERT(jsobj);
+    MOZ_ASSERT(jsobj);
     return jsd_GetJSDObjectForJSObject(jsdc, jsobj);
 }
 
 JSD_PUBLIC_API(JSDObject*)
 JSD_GetObjectForValue(JSDContext* jsdc, JSDValue* jsdval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_VALUE(jsdval);
--- a/js/jsd/jshash.cpp
+++ b/js/jsd/jshash.cpp
@@ -171,17 +171,17 @@ JS_HashTableRawLookup(JSHashTable *ht, J
 
 static bool
 Resize(JSHashTable *ht, uint32_t newshift)
 {
     size_t nb, nentries, i;
     JSHashEntry **oldbuckets, *he, *next, **hep;
     size_t nold = NBUCKETS(ht);
 
-    JS_ASSERT(newshift < JS_HASH_BITS);
+    MOZ_ASSERT(newshift < JS_HASH_BITS);
 
     nb = (size_t)1 << (JS_HASH_BITS - newshift);
 
     /* Integer overflow protection. */
     if (nb > (size_t)-1 / sizeof(JSHashEntry*))
         return false;
     nb *= sizeof(JSHashEntry*);
 
@@ -193,17 +193,17 @@ Resize(JSHashTable *ht, uint32_t newshif
     }
     memset(ht->buckets, 0, nb);
 
     ht->shift = newshift;
     nentries = ht->nentries;
 
     for (i = 0; nentries != 0; i++) {
         for (he = oldbuckets[i]; he; he = next) {
-            JS_ASSERT(nentries != 0);
+            MOZ_ASSERT(nentries != 0);
             --nentries;
             next = he->next;
             hep = BUCKET_HEAD(ht, he->keyHash);
 
             /*
              * We do not require unique entries, instead appending he to the
              * chain starting at hep.
              */
@@ -334,17 +334,17 @@ JS_HashTableEnumerateEntries(JSHashTable
     uint32_t nlimit, n, nbuckets, newlog2;
     int rv;
 
     nlimit = ht->nentries;
     n = 0;
     for (bucket = ht->buckets; n != nlimit; ++bucket) {
         hep = bucket;
         while ((he = *hep) != nullptr) {
-            JS_ASSERT(n < nlimit);
+            MOZ_ASSERT(n < nlimit);
             rv = f(he, n, arg);
             n++;
             if (rv & HT_ENUMERATE_REMOVE) {
                 *hep = he->next;
                 ht->allocOps->freeEntry(ht->allocPriv, he, HT_FREE_ENTRY);
                 --ht->nentries;
             } else {
                 hep = &he->next;
@@ -353,25 +353,25 @@ JS_HashTableEnumerateEntries(JSHashTable
                 goto out;
             }
         }
     }
 
 out:
     /* Shrink table if removal of entries made it underloaded */
     if (ht->nentries != nlimit) {
-        JS_ASSERT(ht->nentries < nlimit);
+        MOZ_ASSERT(ht->nentries < nlimit);
         nbuckets = NBUCKETS(ht);
         if (MINBUCKETS < nbuckets && ht->nentries < UNDERLOADED(nbuckets)) {
             newlog2 = CeilingLog2Size(ht->nentries);
             if (newlog2 < MINBUCKETSLOG2)
                 newlog2 = MINBUCKETSLOG2;
 
             /*  Check that we really shrink the table. */
-            JS_ASSERT(JS_HASH_BITS - ht->shift > newlog2);
+            MOZ_ASSERT(JS_HASH_BITS - ht->shift > newlog2);
             Resize(ht, JS_HASH_BITS - newlog2);
         }
     }
     return (int)n;
 }
 
 #ifdef JS_HASHMETER
 #include <stdio.h>
--- a/js/public/CharacterEncoding.h
+++ b/js/public/CharacterEncoding.h
@@ -45,23 +45,23 @@ class Latin1CharsZ : public mozilla::Ran
     typedef mozilla::RangedPtr<unsigned char> Base;
 
   public:
     Latin1CharsZ() : Base(nullptr, 0) {}
 
     Latin1CharsZ(char *aBytes, size_t aLength)
       : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)
     {
-        JS_ASSERT(aBytes[aLength] == '\0');
+        MOZ_ASSERT(aBytes[aLength] == '\0');
     }
 
     Latin1CharsZ(unsigned char *aBytes, size_t aLength)
       : Base(aBytes, aLength)
     {
-        JS_ASSERT(aBytes[aLength] == '\0');
+        MOZ_ASSERT(aBytes[aLength] == '\0');
     }
 
     using Base::operator=;
 
     char *c_str() { return reinterpret_cast<char *>(get()); }
 };
 
 class UTF8Chars : public mozilla::Range<unsigned char>
@@ -86,23 +86,23 @@ class UTF8CharsZ : public mozilla::Range
     typedef mozilla::RangedPtr<unsigned char> Base;
 
   public:
     UTF8CharsZ() : Base(nullptr, 0) {}
 
     UTF8CharsZ(char *aBytes, size_t aLength)
       : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)
     {
-        JS_ASSERT(aBytes[aLength] == '\0');
+        MOZ_ASSERT(aBytes[aLength] == '\0');
     }
 
     UTF8CharsZ(unsigned char *aBytes, size_t aLength)
       : Base(aBytes, aLength)
     {
-        JS_ASSERT(aBytes[aLength] == '\0');
+        MOZ_ASSERT(aBytes[aLength] == '\0');
     }
 
     using Base::operator=;
 
     char *c_str() { return reinterpret_cast<char *>(get()); }
 };
 
 /*
@@ -131,17 +131,17 @@ class TwoByteCharsZ : public mozilla::Ra
     typedef mozilla::RangedPtr<jschar> Base;
 
   public:
     TwoByteCharsZ() : Base(nullptr, 0) {}
 
     TwoByteCharsZ(jschar *chars, size_t length)
       : Base(chars, length)
     {
-        JS_ASSERT(chars[length] == '\0');
+        MOZ_ASSERT(chars[length] == '\0');
     }
 
     using Base::operator=;
 };
 
 typedef mozilla::RangedPtr<const jschar> ConstCharPtr;
 
 /*
--- a/js/public/Class.h
+++ b/js/public/Class.h
@@ -71,80 +71,80 @@ class SpecialId
   public:
     SpecialId() : bits_(TYPE_VOID) { }
 
     /* Object-valued */
 
     SpecialId(JSObject &obj)
       : bits_(uintptr_t(&obj) | TYPE_OBJECT)
     {
-        JS_ASSERT(&obj != nullptr);
-        JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);
+        MOZ_ASSERT(&obj != nullptr);
+        MOZ_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);
     }
 
     bool isObject() const {
         return (bits_ & TYPE_MASK) == TYPE_OBJECT && bits_ != TYPE_OBJECT;
     }
 
     JSObject *toObject() const {
-        JS_ASSERT(isObject());
+        MOZ_ASSERT(isObject());
         return reinterpret_cast<JSObject *>(bits_ & ~TYPE_MASK);
     }
 
     /* Empty */
 
     static SpecialId empty() {
         SpecialId sid(TYPE_OBJECT);
-        JS_ASSERT(sid.isEmpty());
+        MOZ_ASSERT(sid.isEmpty());
         return sid;
     }
 
     bool isEmpty() const {
         return bits_ == TYPE_OBJECT;
     }
 
     /* Void */
 
     static SpecialId voidId() {
         SpecialId sid(TYPE_VOID);
-        JS_ASSERT(sid.isVoid());
+        MOZ_ASSERT(sid.isVoid());
         return sid;
     }
 
     bool isVoid() const {
         return bits_ == TYPE_VOID;
     }
 };
 
 static MOZ_ALWAYS_INLINE jsid
 SPECIALID_TO_JSID(const SpecialId &sid)
 {
     jsid id;
     JSID_BITS(id) = sid.bits_;
-    JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());
-    JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));
-    JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));
+    MOZ_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());
+    MOZ_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));
+    MOZ_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));
     return id;
 }
 
 static MOZ_ALWAYS_INLINE bool
 JSID_IS_SPECIAL(jsid id)
 {
     return JSID_IS_OBJECT(id) || JSID_IS_EMPTY(id) || JSID_IS_VOID(id);
 }
 
 static MOZ_ALWAYS_INLINE SpecialId
 JSID_TO_SPECIALID(jsid id)
 {
-    JS_ASSERT(JSID_IS_SPECIAL(id));
+    MOZ_ASSERT(JSID_IS_SPECIAL(id));
     if (JSID_IS_OBJECT(id))
         return SpecialId(*JSID_TO_OBJECT(id));
     if (JSID_IS_EMPTY(id))
         return SpecialId::empty();
-    JS_ASSERT(JSID_IS_VOID(id));
+    MOZ_ASSERT(JSID_IS_VOID(id));
     return SpecialId::voidId();
 }
 
 typedef JS::Handle<SpecialId> HandleSpecialId;
 
 } // namespace js
 
 // JSClass operation signatures.
--- a/js/public/GCAPI.h
+++ b/js/public/GCAPI.h
@@ -383,17 +383,17 @@ class JS_PUBLIC_API(ObjectPtr)
     Heap<JSObject *> value;
 
   public:
     ObjectPtr() : value(nullptr) {}
 
     ObjectPtr(JSObject *obj) : value(obj) {}
 
     /* Always call finalize before the destructor. */
-    ~ObjectPtr() { JS_ASSERT(!value); }
+    ~ObjectPtr() { MOZ_ASSERT(!value); }
 
     void finalize(JSRuntime *rt) {
         if (IsIncrementalBarrierNeeded(rt))
             IncrementalObjectBarrier(value);
         value = nullptr;
     }
 
     void init(JSObject *obj) { value = obj; }
@@ -430,17 +430,17 @@ UnmarkGrayGCThingRecursively(void *thing
  * This should be called when an object that is marked gray is exposed to the JS
  * engine (by handing it to running JS code or writing it into live JS
  * data). During incremental GC, since the gray bits haven't been computed yet,
  * we conservatively mark the object black.
  */
 static MOZ_ALWAYS_INLINE void
 ExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind)
 {
-    JS_ASSERT(kind != JSTRACE_SHAPE);
+    MOZ_ASSERT(kind != JSTRACE_SHAPE);
 
     shadow::Runtime *rt = js::gc::GetGCThingRuntime(thing);
 #ifdef JSGC_GENERATIONAL
     /*
      * GC things residing in the nursery cannot be gray: they have no mark bits.
      * All live objects in the nursery are moved to tenured at the beginning of
      * each GC slice, so the gray marker never sees nursery things.
      */
--- a/js/public/HashTable.h
+++ b/js/public/HashTable.h
@@ -526,29 +526,29 @@ class HashSet
 
 // Pointer hashing policy that strips the lowest zeroBits when calculating the
 // hash to improve key distribution.
 template <typename Key, size_t zeroBits>
 struct PointerHasher
 {
     typedef Key Lookup;
     static HashNumber hash(const Lookup &l) {
-        JS_ASSERT(!JS::IsPoisonedPtr(l));
+        MOZ_ASSERT(!JS::IsPoisonedPtr(l));
         size_t word = reinterpret_cast<size_t>(l) >> zeroBits;
         JS_STATIC_ASSERT(sizeof(HashNumber) == 4);
 #if JS_BITS_PER_WORD == 32
         return HashNumber(word);
 #else
         JS_STATIC_ASSERT(sizeof word == 8);
         return HashNumber((word >> 32) ^ word);
 #endif
     }
     static bool match(const Key &k, const Lookup &l) {
-        JS_ASSERT(!JS::IsPoisonedPtr(k));
-        JS_ASSERT(!JS::IsPoisonedPtr(l));
+        MOZ_ASSERT(!JS::IsPoisonedPtr(k));
+        MOZ_ASSERT(!JS::IsPoisonedPtr(l));
         return k == l;
     }
     static void rekey(Key &k, const Key& newKey) {
         k = newKey;
     }
 };
 
 // Default hash policy: just use the 'lookup' value. This of course only
@@ -696,47 +696,47 @@ class HashTableEntry
     // NB: HashTableEntry is treated as a POD: no constructor or destructor calls.
 
     void destroyIfLive() {
         if (isLive())
             mem.addr()->~T();
     }
 
     void destroy() {
-        JS_ASSERT(isLive());
+        MOZ_ASSERT(isLive());
         mem.addr()->~T();
     }
 
     void swap(HashTableEntry *other) {
         mozilla::Swap(keyHash, other->keyHash);
         mozilla::Swap(mem, other->mem);
     }
 
-    T &get() { JS_ASSERT(isLive()); return *mem.addr(); }
+    T &get() { MOZ_ASSERT(isLive()); return *mem.addr(); }
 
     bool isFree() const    { return keyHash == sFreeKey; }
-    void clearLive()       { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }
+    void clearLive()       { MOZ_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }
     void clear()           { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; }
     bool isRemoved() const { return keyHash == sRemovedKey; }
-    void removeLive()      { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }
+    void removeLive()      { MOZ_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }
     bool isLive() const    { return isLiveHash(keyHash); }
-    void setCollision()               { JS_ASSERT(isLive()); keyHash |= sCollisionBit; }
-    void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; }
+    void setCollision()               { MOZ_ASSERT(isLive()); keyHash |= sCollisionBit; }
+    void setCollision(HashNumber bit) { MOZ_ASSERT(isLive()); keyHash |= bit; }
     void unsetCollision()             { keyHash &= ~sCollisionBit; }
     bool hasCollision() const         { return keyHash & sCollisionBit; }
     bool matchHash(HashNumber hn)     { return (keyHash & ~sCollisionBit) == hn; }
     HashNumber getKeyHash() const     { return keyHash & ~sCollisionBit; }
 
     template <class U>
     void setLive(HashNumber hn, U &&u)
     {
-        JS_ASSERT(!isLive());
+        MOZ_ASSERT(!isLive());
         keyHash = hn;
         new(mem.addr()) T(mozilla::Forward<U>(u));
-        JS_ASSERT(isLive());
+        MOZ_ASSERT(isLive());
     }
 };
 
 template <class T, class HashPolicy, class AllocPolicy>
 class HashTable : private AllocPolicy
 {
     typedef typename mozilla::RemoveConst<T>::Type NonConstT;
     typedef typename HashPolicy::KeyType Key;
@@ -774,41 +774,41 @@ class HashTable : private AllocPolicy
         // Leaves Ptr uninitialized.
         Ptr() {
 #ifdef JS_DEBUG
             entry_ = (Entry *)0xbad;
 #endif
         }
 
         bool found() const {
-            JS_ASSERT(generation == table_->generation());
+            MOZ_ASSERT(generation == table_->generation());
             return entry_->isLive();
         }
 
         operator ConvertibleToBool() const {
             return found() ? &Ptr::nonNull : 0;
         }
 
         bool operator==(const Ptr &rhs) const {
-            JS_ASSERT(found() && rhs.found());
+            MOZ_ASSERT(found() && rhs.found());
             return entry_ == rhs.entry_;
         }
 
         bool operator!=(const Ptr &rhs) const {
-            JS_ASSERT(generation == table_->generation());
+            MOZ_ASSERT(generation == table_->generation());
             return !(*this == rhs);
         }
 
         T &operator*() const {
-            JS_ASSERT(generation == table_->generation());
+            MOZ_ASSERT(generation == table_->generation());
             return entry_->get();
         }
 
         T *operator->() const {
-            JS_ASSERT(generation == table_->generation());
+            MOZ_ASSERT(generation == table_->generation());
             return &entry_->get();
         }
     };
 
     // A Ptr that can be used to add a key after a failed lookup.
     class AddPtr : public Ptr
     {
         friend class HashTable;
@@ -863,33 +863,33 @@ class HashTable : private AllocPolicy
           , table_(nullptr)
           , mutationCount(0)
           , generation(0)
           , validEntry(false)
 #endif
         {}
 
         bool empty() const {
-            JS_ASSERT(generation == table_->generation());
-            JS_ASSERT(mutationCount == table_->mutationCount);
+            MOZ_ASSERT(generation == table_->generation());
+            MOZ_ASSERT(mutationCount == table_->mutationCount);
             return cur == end;
         }
 
         T &front() const {
-            JS_ASSERT(validEntry);
-            JS_ASSERT(!empty());
-            JS_ASSERT(generation == table_->generation());
-            JS_ASSERT(mutationCount == table_->mutationCount);
+            MOZ_ASSERT(validEntry);
+            MOZ_ASSERT(!empty());
+            MOZ_ASSERT(generation == table_->generation());
+            MOZ_ASSERT(mutationCount == table_->mutationCount);
             return cur->get();
         }
 
         void popFront() {
-            JS_ASSERT(!empty());
-            JS_ASSERT(generation == table_->generation());
-            JS_ASSERT(mutationCount == table_->mutationCount);
+            MOZ_ASSERT(!empty());
+            MOZ_ASSERT(generation == table_->generation());
+            MOZ_ASSERT(mutationCount == table_->mutationCount);
             while (++cur < end && !cur->isLive())
                 continue;
 #ifdef DEBUG
             validEntry = true;
 #endif
         }
     };
 
@@ -1073,17 +1073,17 @@ class HashTable : private AllocPolicy
         removedCount(0),
         table(nullptr),
         entered(false),
         mutationCount(0)
     {}
 
     MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)
     {
-        JS_ASSERT(!initialized());
+        MOZ_ASSERT(!initialized());
 
         // Reject all lengths whose initial computed capacity would exceed
         // sMaxCapacity.  Round that maximum length down to the nearest power
         // of two for speedier code.
         if (length > sMaxInit) {
             this->reportAllocOverflow();
             return false;
         }
@@ -1183,20 +1183,20 @@ class HashTable : private AllocPolicy
 
     static bool match(Entry &e, const Lookup &l)
     {
         return HashPolicy::match(HashPolicy::getKey(e.get()), l);
     }
 
     Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const
     {
-        JS_ASSERT(isLiveHash(keyHash));
-        JS_ASSERT(!(keyHash & sCollisionBit));
-        JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);
-        JS_ASSERT(table);
+        MOZ_ASSERT(isLiveHash(keyHash));
+        MOZ_ASSERT(!(keyHash & sCollisionBit));
+        MOZ_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);
+        MOZ_ASSERT(table);
         METER(stats.searches++);
 
         // Compute the primary hash address.
         HashNumber h1 = hash1(keyHash);
         Entry *entry = &table[h1];
 
         // Miss: return space for a new entry.
         if (entry->isFree()) {
@@ -1243,18 +1243,18 @@ class HashTable : private AllocPolicy
     // This is a copy of lookup hardcoded to the assumptions:
     //   1. the lookup is a lookupForAdd
     //   2. the key, whose |keyHash| has been passed is not in the table,
     //   3. no entries have been removed from the table.
     // This specialized search avoids the need for recovering lookup values
     // from entries, which allows more flexible Lookup/Key types.
     Entry &findFreeEntry(HashNumber keyHash)
     {
-        JS_ASSERT(!(keyHash & sCollisionBit));
-        JS_ASSERT(table);
+        MOZ_ASSERT(!(keyHash & sCollisionBit));
+        MOZ_ASSERT(table);
         METER(stats.searches++);
 
         // We assume 'keyHash' has already been distributed.
 
         // Compute the primary hash address.
         HashNumber h1 = hash1(keyHash);
         Entry *entry = &table[h1];
 
@@ -1263,17 +1263,17 @@ class HashTable : private AllocPolicy
             METER(stats.misses++);
             return *entry;
         }
 
         // Collision: double hash.
         DoubleHash dh = hash2(keyHash);
 
         while(true) {
-            JS_ASSERT(!entry->isRemoved());
+            MOZ_ASSERT(!entry->isRemoved());
             entry->setCollision();
 
             METER(stats.steps++);
             h1 = applyDoubleHash(h1, dh);
 
             entry = &table[h1];
             if (!entry->isLive()) {
                 METER(stats.misses++);
@@ -1344,17 +1344,17 @@ class HashTable : private AllocPolicy
         if (overloaded()) {
             if (checkOverloaded() == RehashFailed)
                 rehashTableInPlace();
         }
     }
 
     void remove(Entry &e)
     {
-        JS_ASSERT(table);
+        MOZ_ASSERT(table);
         METER(stats.removes++);
 
         if (e.hasCollision()) {
             e.removeLive();
             removedCount++;
         } else {
             METER(stats.removeFrees++);
             e.clearLive();
@@ -1443,56 +1443,56 @@ class HashTable : private AllocPolicy
         }
         removedCount = 0;
         entryCount = 0;
         mutationCount++;
     }
 
     void finish()
     {
-        JS_ASSERT(!entered);
+        MOZ_ASSERT(!entered);
 
         if (!table)
             return;
 
         destroyTable(*this, table, capacity());
         table = nullptr;
         gen++;
         entryCount = 0;
         removedCount = 0;
         mutationCount++;
     }
 
     Range all() const
     {
-        JS_ASSERT(table);
+        MOZ_ASSERT(table);
         return Range(*this, table, table + capacity());
     }
 
     bool empty() const
     {
-        JS_ASSERT(table);
+        MOZ_ASSERT(table);
         return !entryCount;
     }
 
     uint32_t count() const
     {
-        JS_ASSERT(table);
+        MOZ_ASSERT(table);
         return entryCount;
     }
 
     uint32_t capacity() const
     {
-        JS_ASSERT(table);
+        MOZ_ASSERT(table);
         return JS_BIT(sHashBits - hashShift);
     }
 
     uint32_t generation() const
     {
-        JS_ASSERT(table);
+        MOZ_ASSERT(table);
         return gen;
     }
 
     size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
     {
         return mallocSizeOf(table);
     }
 
@@ -1522,19 +1522,19 @@ class HashTable : private AllocPolicy
         AddPtr p(entry, *this, keyHash);
         return p;
     }
 
     template <class U>
     bool add(AddPtr &p, U &&u)
     {
         mozilla::ReentrancyGuard g(*this);
-        JS_ASSERT(table);
-        JS_ASSERT(!p.found());
-        JS_ASSERT(!(p.keyHash & sCollisionBit));
+        MOZ_ASSERT(table);
+        MOZ_ASSERT(!p.found());
+        MOZ_ASSERT(!(p.keyHash & sCollisionBit));
 
         // Changing an entry from removed to live does not affect whether we
         // are overloaded and can be handled separately.
         if (p.entry_->isRemoved()) {
             METER(stats.addOverRemoved++);
             removedCount--;
             p.keyHash |= sCollisionBit;
         } else {
@@ -1556,17 +1556,17 @@ class HashTable : private AllocPolicy
         return true;
     }
 
     // Note: |l| may be a reference to a piece of |u|, so this function
     // must take care not to use |l| after moving |u|.
     template <class U>
     void putNewInfallible(const Lookup &l, U &&u)
     {
-        JS_ASSERT(table);
+        MOZ_ASSERT(table);
 
         HashNumber keyHash = prepareHash(l);
         Entry *entry = &findFreeEntry(keyHash);
 
         if (entry->isRemoved()) {
             METER(stats.addOverRemoved++);
             removedCount--;
             keyHash |= sCollisionBit;
@@ -1595,36 +1595,36 @@ class HashTable : private AllocPolicy
     bool relookupOrAdd(AddPtr& p, const Lookup &l, U &&u)
     {
 #ifdef DEBUG
         p.generation = generation();
         p.mutationCount = mutationCount;
 #endif
         {
             mozilla::ReentrancyGuard g(*this);
-            JS_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed
+            MOZ_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed
             p.entry_ = &lookup(l, p.keyHash, sCollisionBit);
         }
         return p.found() || add(p, mozilla::Forward<U>(u));
     }
 
     void remove(Ptr p)
     {
-        JS_ASSERT(table);
+        MOZ_ASSERT(table);
         mozilla::ReentrancyGuard g(*this);
-        JS_ASSERT(p.found());
+        MOZ_ASSERT(p.found());
         remove(*p.entry_);
         checkUnderloaded();
     }
 
     void rekeyWithoutRehash(Ptr p, const Lookup &l, const Key &k)
     {
-        JS_ASSERT(table);
+        MOZ_ASSERT(table);
         mozilla::ReentrancyGuard g(*this);
-        JS_ASSERT(p.found());
+        MOZ_ASSERT(p.found());
         typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));
         HashPolicy::setKey(t, const_cast<Key &>(k));
         remove(*p.entry_);
         putNewInfallible(l, mozilla::Move(t));
     }
 
     void rekeyAndMaybeRehash(Ptr p, const Lookup &l, const Key &k)
     {
--- a/js/public/HeapAPI.h
+++ b/js/public/HeapAPI.h
@@ -81,23 +81,23 @@ struct Zone
         needsBarrier_(false)
     {}
 
     bool needsBarrier() const {
         return needsBarrier_;
     }
 
     JSTracer *barrierTracer() {
-        JS_ASSERT(needsBarrier_);
-        JS_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
+        MOZ_ASSERT(needsBarrier_);
+        MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
         return barrierTracer_;
     }
 
     JSRuntime *runtimeFromMainThread() const {
-        JS_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
+        MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
         return runtime_;
     }
 
     // Note: Unrestricted access to the zone's runtime from an arbitrary
     // thread can easily lead to races. Use this method very carefully.
     JSRuntime *runtimeFromAnyThread() const {
         return runtime_;
     }
@@ -111,40 +111,40 @@ struct Zone
 } /* namespace JS */
 
 namespace js {
 namespace gc {
 
 static MOZ_ALWAYS_INLINE uintptr_t *
 GetGCThingMarkBitmap(const void *thing)
 {
-    JS_ASSERT(thing);
+    MOZ_ASSERT(thing);
     uintptr_t addr = uintptr_t(thing);
     addr &= ~js::gc::ChunkMask;
     addr |= js::gc::ChunkMarkBitmapOffset;
     return reinterpret_cast<uintptr_t *>(addr);
 }
 
 static MOZ_ALWAYS_INLINE JS::shadow::Runtime *
 GetGCThingRuntime(const void *thing)
 {
-    JS_ASSERT(thing);
+    MOZ_ASSERT(thing);
     uintptr_t addr = uintptr_t(thing);
     addr &= ~js::gc::ChunkMask;
     addr |= js::gc::ChunkRuntimeOffset;
     return *reinterpret_cast<JS::shadow::Runtime **>(addr);
 }
 
 static MOZ_ALWAYS_INLINE void
 GetGCThingMarkWordAndMask(const void *thing, uint32_t color,
                           uintptr_t **wordp, uintptr_t *maskp)
 {
     uintptr_t addr = uintptr_t(thing);
     size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;
-    JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);
+    MOZ_ASSERT(bit < js::gc::ChunkMarkBitmapBits);
     uintptr_t *bitmap = GetGCThingMarkBitmap(thing);
     const uintptr_t nbits = sizeof(*bitmap) * CHAR_BIT;
     *maskp = uintptr_t(1) << (bit % nbits);
     *wordp = &bitmap[bit / nbits];
 }
 
 static MOZ_ALWAYS_INLINE JS::shadow::ArenaHeader *
 GetGCThingArena(void *thing)
@@ -168,17 +168,17 @@ IsInsideNursery(const JS::shadow::Runtim
 
 } /* namespace js */
 
 namespace JS {
 
 static MOZ_ALWAYS_INLINE Zone *
 GetGCThingZone(void *thing)
 {
-    JS_ASSERT(thing);
+    MOZ_ASSERT(thing);
     return js::gc::GetGCThingArena(thing)->zone;
 }
 
 static MOZ_ALWAYS_INLINE Zone *
 GetObjectZone(JSObject *obj)
 {
     return GetGCThingZone(obj);
 }
--- a/js/public/Id.h
+++ b/js/public/Id.h
@@ -50,17 +50,17 @@ static MOZ_ALWAYS_INLINE bool
 JSID_IS_STRING(jsid id)
 {
     return (JSID_BITS(id) & JSID_TYPE_MASK) == 0;
 }
 
 static MOZ_ALWAYS_INLINE JSString *
 JSID_TO_STRING(jsid id)
 {
-    JS_ASSERT(JSID_IS_STRING(id));
+    MOZ_ASSERT(JSID_IS_STRING(id));
     return (JSString *)JSID_BITS(id);
 }
 
 static MOZ_ALWAYS_INLINE bool
 JSID_IS_ZERO(jsid id)
 {
     return JSID_BITS(id) == 0;
 }
@@ -69,58 +69,58 @@ static MOZ_ALWAYS_INLINE bool
 JSID_IS_INT(jsid id)
 {
     return !!(JSID_BITS(id) & JSID_TYPE_INT);
 }
 
 static MOZ_ALWAYS_INLINE int32_t
 JSID_TO_INT(jsid id)
 {
-    JS_ASSERT(JSID_IS_INT(id));
+    MOZ_ASSERT(JSID_IS_INT(id));
     return ((uint32_t)JSID_BITS(id)) >> 1;
 }
 
 #define JSID_INT_MIN  0
 #define JSID_INT_MAX  INT32_MAX
 
 static MOZ_ALWAYS_INLINE bool
 INT_FITS_IN_JSID(int32_t i)
 {
     return i >= 0;
 }
 
 static MOZ_ALWAYS_INLINE jsid
 INT_TO_JSID(int32_t i)
 {
     jsid id;
-    JS_ASSERT(INT_FITS_IN_JSID(i));
+    MOZ_ASSERT(INT_FITS_IN_JSID(i));
     JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);
     return id;
 }
 
 static MOZ_ALWAYS_INLINE bool
 JSID_IS_OBJECT(jsid id)
 {
     return (JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_OBJECT &&
            (size_t)JSID_BITS(id) != JSID_TYPE_OBJECT;
 }
 
 static MOZ_ALWAYS_INLINE JSObject *
 JSID_TO_OBJECT(jsid id)
 {
-    JS_ASSERT(JSID_IS_OBJECT(id));
+    MOZ_ASSERT(JSID_IS_OBJECT(id));
     return (JSObject *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);
 }
 
 static MOZ_ALWAYS_INLINE jsid
 OBJECT_TO_JSID(JSObject *obj)
 {
     jsid id;
-    JS_ASSERT(obj != nullptr);
-    JS_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);
+    MOZ_ASSERT(obj != nullptr);
+    MOZ_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);
     JSID_BITS(id) = ((size_t)obj | JSID_TYPE_OBJECT);
     return id;
 }
 
 static MOZ_ALWAYS_INLINE bool
 JSID_IS_GCTHING(jsid id)
 {
     return JSID_IS_STRING(id) || JSID_IS_OBJECT(id);
@@ -130,17 +130,17 @@ static MOZ_ALWAYS_INLINE void *
 JSID_TO_GCTHING(jsid id)
 {
     return (void *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);
 }
 
 static MOZ_ALWAYS_INLINE bool
 JSID_IS_VOID(const jsid id)
 {
-    JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
+    MOZ_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
                  JSID_BITS(id) == JSID_TYPE_VOID);
     return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);
 }
 
 static MOZ_ALWAYS_INLINE bool
 JSID_IS_EMPTY(const jsid id)
 {
     return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT);
--- a/js/public/ProfilingStack.h
+++ b/js/public/ProfilingStack.h
@@ -46,26 +46,26 @@ class ProfileEntry
 
   public:
     // All of these methods are marked with the 'volatile' keyword because SPS's
     // representation of the stack is stored such that all ProfileEntry
     // instances are volatile. These methods would not be available unless they
     // were marked as volatile as well.
 
     bool js() const volatile {
-        JS_ASSERT_IF(sp == nullptr, script_ != nullptr);
+        MOZ_ASSERT_IF(sp == nullptr, script_ != nullptr);
         return sp == nullptr;
     }
 
-    uint32_t line() const volatile { JS_ASSERT(!js()); return idx; }
-    JSScript *script() const volatile { JS_ASSERT(js()); return script_; }
+    uint32_t line() const volatile { MOZ_ASSERT(!js()); return idx; }
+    JSScript *script() const volatile { MOZ_ASSERT(js()); return script_; }
     void *stackAddress() const volatile { return sp; }
     const char *label() const volatile { return string; }
 
-    void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; }
+    void setLine(uint32_t aLine) volatile { MOZ_ASSERT(!js()); idx = aLine; }
     void setLabel(const char *aString) volatile { string = aString; }
     void setStackAddress(void *aSp) volatile { sp = aSp; }
     void setScript(JSScript *aScript) volatile { script_ = aScript; }
 
     // We can't know the layout of JSScript, so look in vm/SPSProfiler.cpp.
     JS_FRIEND_API(jsbytecode *) pc() const volatile;
     JS_FRIEND_API(void) setPC(jsbytecode *pc) volatile;
 
--- a/js/public/RootingAPI.h
+++ b/js/public/RootingAPI.h
@@ -233,39 +233,39 @@ class Heap : public js::HeapBase<T>
     }
 
     Heap<T> &operator=(const Heap<T>& other) {
         set(other.get());
         return *this;
     }
 
     void set(T newPtr) {
-        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
         if (js::GCMethods<T>::needsPostBarrier(newPtr)) {
             ptr = newPtr;
             post();
         } else if (js::GCMethods<T>::needsPostBarrier(ptr)) {
             relocate();  /* Called before overwriting ptr. */
             ptr = newPtr;
         } else {
             ptr = newPtr;
         }
     }
 
   private:
     void init(T newPtr) {
-        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
         ptr = newPtr;
         if (js::GCMethods<T>::needsPostBarrier(ptr))
             post();
     }
 
     void post() {
 #ifdef JSGC_GENERATIONAL
-        JS_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));
+        MOZ_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));
         js::GCMethods<T>::postBarrier(&ptr);
 #endif
     }
 
     void relocate() {
 #ifdef JSGC_GENERATIONAL
         js::GCMethods<T>::relocate(&ptr);
 #endif
@@ -325,35 +325,35 @@ class TenuredHeap : public js::HeapBase<
     }
     explicit TenuredHeap(T p) : bits(0) { setPtr(p); }
     explicit TenuredHeap(const TenuredHeap<T> &p) : bits(0) { setPtr(p.ptr); }
 
     bool operator==(const TenuredHeap<T> &other) { return bits == other.bits; }
     bool operator!=(const TenuredHeap<T> &other) { return bits != other.bits; }
 
     void setPtr(T newPtr) {
-        JS_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);
-        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
+        MOZ_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
         if (newPtr)
             AssertGCThingMustBeTenured(newPtr);
         bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);
     }
 
     void setFlags(uintptr_t flagsToSet) {
-        JS_ASSERT((flagsToSet & ~flagsMask) == 0);
+        MOZ_ASSERT((flagsToSet & ~flagsMask) == 0);
         bits |= flagsToSet;
     }
 
     void unsetFlags(uintptr_t flagsToUnset) {
-        JS_ASSERT((flagsToUnset & ~flagsMask) == 0);
+        MOZ_ASSERT((flagsToUnset & ~flagsMask) == 0);
         bits &= ~flagsToUnset;
     }
 
     bool hasFlag(uintptr_t flag) const {
-        JS_ASSERT((flag & ~flagsMask) == 0);
+        MOZ_ASSERT((flag & ~flagsMask) == 0);
         return (bits & flag) != 0;
     }
 
     T getPtr() const { return reinterpret_cast<T>(bits & ~flagsMask); }
     uintptr_t getFlags() const { return bits & flagsMask; }
 
     operator T() const { return getPtr(); }
     T operator->() const { return getPtr(); }
@@ -524,17 +524,17 @@ class MOZ_STACK_CLASS MutableHandle : pu
                   typename mozilla::EnableIf<mozilla::IsNullPointer<N>::value ||
                                              mozilla::IsSame<N, int>::value ||
                                              mozilla::IsSame<N, long>::value,
                                              int>::Type dummy = 0)
     MOZ_DELETE;
 
   public:
     void set(T v) {
-        JS_ASSERT(!js::GCMethods<T>::poisoned(v));
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(v));
         *ptr = v;
     }
 
     /*
      * This may be called only if the location of the T is guaranteed
      * to be marked (for some reason other than being a Rooted),
      * e.g., if it is guaranteed to be reachable from an implicit root.
      *
@@ -690,17 +690,17 @@ class MOZ_STACK_CLASS Rooted : public js
     template <typename CX>
     void init(CX *cx) {
 #ifdef JSGC_TRACK_EXACT_ROOTS
         js::ThingRootKind kind = js::GCMethods<T>::kind();
         this->stack = &cx->thingGCRooters[kind];
         this->prev = *stack;
         *stack = reinterpret_cast<Rooted<void*>*>(this);
 
-        JS_ASSERT(!js::GCMethods<T>::poisoned(ptr));
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(ptr));
 #endif
     }
 
   public:
     Rooted(JSContext *cx
            MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : ptr(js::GCMethods<T>::initial())
     {
@@ -770,17 +770,17 @@ class MOZ_STACK_CLASS Rooted : public js
         init(js::PerThreadDataFriendFields::getMainThread(rt));
     }
 
     // Note that we need to let the compiler generate the default destructor in
     // non-exact-rooting builds because of a bug in the instrumented PGO builds
     // using MSVC, see bug 915735 for more details.
 #ifdef JSGC_TRACK_EXACT_ROOTS
     ~Rooted() {
-        JS_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));
+        MOZ_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));
         *stack = prev;
     }
 #endif
 
 #ifdef JSGC_TRACK_EXACT_ROOTS
     Rooted<T> *previous() { return prev; }
 #endif
 
@@ -791,28 +791,28 @@ class MOZ_STACK_CLASS Rooted : public js
     operator const T&() const { return ptr; }
     T operator->() const { return ptr; }
     T *address() { return &ptr; }
     const T *address() const { return &ptr; }
     T &get() { return ptr; }
     const T &get() const { return ptr; }
 
     T &operator=(T value) {
-        JS_ASSERT(!js::GCMethods<T>::poisoned(value));
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
         ptr = value;
         return ptr;
     }
 
     T &operator=(const Rooted &value) {
         ptr = value;
         return ptr;
     }
 
     void set(T value) {
-        JS_ASSERT(!js::GCMethods<T>::poisoned(value));
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
         ptr = value;
     }
 
     bool operator!=(const T &other) const { return ptr != other; }
     bool operator==(const T &other) const { return ptr == other; }
 
   private:
 #ifdef JSGC_TRACK_EXACT_ROOTS
@@ -882,17 +882,17 @@ class SkipRoot
         this->prev = *stack;
         *stack = this;
         this->start = (const uint8_t *) ptr;
         this->end = this->start + (sizeof(T) * count);
     }
 
   public:
     ~SkipRoot() {
-        JS_ASSERT(*stack == this);
+        MOZ_ASSERT(*stack == this);
         *stack = prev;
     }
 
     SkipRoot *previous() { return prev; }
 
     bool contains(const uint8_t *v, size_t len) {
         return v >= start && v + len <= end;
     }
@@ -1016,23 +1016,23 @@ class FakeRooted : public RootedBase<T>
     operator T() const { return ptr; }
     T operator->() const { return ptr; }
     T *address() { return &ptr; }
     const T *address() const { return &ptr; }
     T &get() { return ptr; }
     const T &get() const { return ptr; }
 
     FakeRooted<T> &operator=(T value) {
-        JS_ASSERT(!GCMethods<T>::poisoned(value));
+        MOZ_ASSERT(!GCMethods<T>::poisoned(value));
         ptr = value;
         return *this;
     }
 
     FakeRooted<T> &operator=(const FakeRooted<T> &other) {
-        JS_ASSERT(!GCMethods<T>::poisoned(other.ptr));
+        MOZ_ASSERT(!GCMethods<T>::poisoned(other.ptr));
         ptr = other.ptr;
         return *this;
     }
 
     bool operator!=(const T &other) const { return ptr != other; }
     bool operator==(const T &other) const { return ptr == other; }
 
   private:
@@ -1052,17 +1052,17 @@ class FakeMutableHandle : public js::Mut
         ptr = t;
     }
 
     FakeMutableHandle(FakeRooted<T> *root) {
         ptr = root->address();
     }
 
     void set(T v) {
-        JS_ASSERT(!js::GCMethods<T>::poisoned(v));
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(v));
         *ptr = v;
     }
 
     T *address() const { return ptr; }
     T get() const { return *ptr; }
 
     operator T() const { return get(); }
     T operator->() const { return get(); }
@@ -1256,28 +1256,28 @@ class PersistentRooted : private mozilla
     operator const T&() const { return ptr; }
     T operator->() const { return ptr; }
     T *address() { return &ptr; }
     const T *address() const { return &ptr; }
     T &get() { return ptr; }
     const T &get() const { return ptr; }
 
     T &operator=(T value) {
-        JS_ASSERT(!js::GCMethods<T>::poisoned(value));
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
         ptr = value;
         return ptr;
     }
 
     T &operator=(const PersistentRooted &value) {
         ptr = value;
         return ptr;
     }
 
     void set(T value) {
-        JS_ASSERT(!js::GCMethods<T>::poisoned(value));
+        MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
         ptr = value;
     }
 
     bool operator!=(const T &other) const { return ptr != other; }
     bool operator==(const T &other) const { return ptr == other; }
 
   private:
     T ptr;
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -387,18 +387,18 @@ CloneNonReflectorsRead(JSContext *cx, JS
         size_t idx;
         if (JS_ReadBytes(reader, &idx, sizeof(size_t))) {
             RootedObject reflector(cx, reflectors->handleAt(idx));
             MOZ_ASSERT(reflector, "No object pointer?");
             MOZ_ASSERT(IsReflector(reflector), "Object pointer must be a reflector!");
 
             if (!JS_WrapObject(cx, &reflector))
                 return nullptr;
-            JS_ASSERT(WrapperFactory::IsXrayWrapper(reflector) ||
-                      IsReflector(reflector));
+            MOZ_ASSERT(WrapperFactory::IsXrayWrapper(reflector) ||
+                       IsReflector(reflector));
 
             return reflector;
         }
     }
 
     JS_ReportError(cx, "CloneNonReflectorsRead error");
     return nullptr;
 }