Bug 952650 (part 2) - Remove JSVAL_IS_VOID. r=evilpies.
authorRodrigo Rodriguez Jr. <rrodrigue96@hotmail.com>
Sun, 27 Apr 2014 19:32:05 -0700
changeset 181291 24f49a2ca817513c6eea574b7e92b8ef883406a2
parent 181290 24dedc2a7064523474d2d61153e3d9713fa2730c
child 181292 840f2ac959d4d3919248b436305f736c608c731a
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersevilpies
bugs952650
milestone32.0a1
Bug 952650 (part 2) - Remove JSVAL_IS_VOID. r=evilpies.
content/canvas/src/CanvasUtils.cpp
content/canvas/src/CanvasUtils.h
dom/indexedDB/IDBCursor.cpp
dom/indexedDB/IDBIndex.cpp
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/IDBRequest.cpp
dom/indexedDB/KeyPath.cpp
dom/workers/XMLHttpRequest.cpp
js/jsd/jsd_val.cpp
js/jsd/jsd_xpc.cpp
js/public/Value.h
js/src/ctypes/CTypes.cpp
js/src/jsapi-tests/testResolveRecursion.cpp
js/src/jscntxt.cpp
js/src/shell/js.cpp
js/src/shell/jsheaptools.cpp
js/src/tests/js1_5/Regress/regress-355829-01.js
js/src/tests/js1_5/Regress/regress-452573-01.js
js/src/tests/js1_5/Regress/regress-453747.js
js/src/tests/js1_5/Regress/regress-459628.js
js/src/vm/StructuredClone.cpp
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/src/XPCConvert.cpp
js/xpconnect/src/XPCQuickStubs.h
toolkit/components/places/History.cpp
--- a/content/canvas/src/CanvasUtils.cpp
+++ b/content/canvas/src/CanvasUtils.cpp
@@ -66,17 +66,17 @@ DoDrawImageSecurityCheck(dom::HTMLCanvas
 
 bool
 CoerceDouble(JS::Value v, double* d)
 {
     if (JSVAL_IS_DOUBLE(v)) {
         *d = JSVAL_TO_DOUBLE(v);
     } else if (JSVAL_IS_INT(v)) {
         *d = double(JSVAL_TO_INT(v));
-    } else if (JSVAL_IS_VOID(v)) {
+    } else if (v.isUndefined()) {
         *d = 0.0;
     } else {
         return false;
     }
     return true;
 }
 
 } // namespace CanvasUtils
--- a/content/canvas/src/CanvasUtils.h
+++ b/content/canvas/src/CanvasUtils.h
@@ -136,17 +136,17 @@ JSValToDashArray(JSContext* cx, const JS
                 return NS_ERROR_OUT_OF_MEMORY;
             }
         }
 
         if (dashes.Length() > 0 && !haveNonzeroElement) {
             // An all-zero pattern makes no sense.
             return NS_ERROR_ILLEGAL_VALUE;
         }
-    } else if (!(JSVAL_IS_VOID(patternArray) || patternArray.isNull())) {
+    } else if (!(patternArray.isUndefined() || patternArray.isNull())) {
         // undefined and null mean "reset to no dash".  Any other
         // random garbage is a type error.
         return NS_ERROR_INVALID_ARG;
     }
 
     return NS_OK;
 }
 
--- a/dom/indexedDB/IDBCursor.cpp
+++ b/dom/indexedDB/IDBCursor.cpp
@@ -512,22 +512,22 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRequest)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTransaction)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mObjectStore)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIndex)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBCursor)
   NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
-  NS_ASSERTION(tmp->mHaveCachedKey || JSVAL_IS_VOID(tmp->mCachedKey),
+  NS_ASSERTION(tmp->mHaveCachedKey || tmp->mCachedKey.isUndefined(),
                "Should have a cached key");
   NS_ASSERTION(tmp->mHaveCachedPrimaryKey ||
-               JSVAL_IS_VOID(tmp->mCachedPrimaryKey),
+               tmp->mCachedPrimaryKey.isUndefined(),
                "Should have a cached primary key");
-  NS_ASSERTION(tmp->mHaveCachedValue || JSVAL_IS_VOID(tmp->mCachedValue),
+  NS_ASSERTION(tmp->mHaveCachedValue || tmp->mCachedValue.isUndefined(),
                "Should have a cached value");
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mScriptOwner)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedKey)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedPrimaryKey)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedValue)
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(IDBCursor)
--- a/dom/indexedDB/IDBIndex.cpp
+++ b/dom/indexedDB/IDBIndex.cpp
@@ -826,17 +826,17 @@ IDBIndex::WrapObject(JSContext* aCx)
   return IDBIndexBinding::Wrap(aCx, this);
 }
 
 JS::Value
 IDBIndex::GetKeyPath(JSContext* aCx, ErrorResult& aRv)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
-  if (!JSVAL_IS_VOID(mCachedKeyPath)) {
+  if (!mCachedKeyPath.isUndefined()) {
     return mCachedKeyPath;
   }
 
   aRv = GetKeyPath().ToJSVal(aCx, mCachedKeyPath);
   ENSURE_SUCCESS(aRv, JSVAL_VOID);
 
   if (JSVAL_IS_GCTHING(mCachedKeyPath)) {
     mozilla::HoldJSObjects(this);
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -1832,17 +1832,17 @@ IDBObjectStore::GetAddInfo(JSContext* aC
                            StructuredCloneWriteInfo& aCloneWriteInfo,
                            Key& aKey,
                            nsTArray<IndexUpdateInfo>& aUpdateInfoArray)
 {
   nsresult rv;
 
   // Return DATA_ERR if a key was passed in and this objectStore uses inline
   // keys.
-  if (!JSVAL_IS_VOID(aKeyVal) && HasValidKeyPath()) {
+  if (!aKeyVal.isUndefined() && HasValidKeyPath()) {
     return NS_ERROR_DOM_INDEXEDDB_DATA_ERR;
   }
 
   JSAutoRequest ar(aCx);
 
   if (!HasValidKeyPath()) {
     // Out-of-line keys must be passed in.
     rv = aKey.SetFromJSVal(aCx, aKeyVal);
@@ -2610,17 +2610,17 @@ IDBObjectStore::WrapObject(JSContext* aC
   return IDBObjectStoreBinding::Wrap(aCx, this);
 }
 
 JS::Value
 IDBObjectStore::GetKeyPath(JSContext* aCx, ErrorResult& aRv)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
-  if (!JSVAL_IS_VOID(mCachedKeyPath)) {
+  if (!mCachedKeyPath.isUndefined()) {
     return mCachedKeyPath;
   }
 
   aRv = GetKeyPath().ToJSVal(aCx, mCachedKeyPath);
   ENSURE_SUCCESS(aRv, JSVAL_VOID);
 
   if (JSVAL_IS_GCTHING(mCachedKeyPath)) {
     mozilla::HoldJSObjects(this);
--- a/dom/indexedDB/IDBRequest.cpp
+++ b/dom/indexedDB/IDBRequest.cpp
@@ -164,17 +164,17 @@ IDBRequest::Reset()
   mError = nullptr;
 }
 
 nsresult
 IDBRequest::NotifyHelperCompleted(HelperBase* aHelper)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
   NS_ASSERTION(!mHaveResultOrErrorCode, "Already called!");
-  NS_ASSERTION(JSVAL_IS_VOID(mResultVal), "Should be undefined!");
+  NS_ASSERTION(mResultVal.isUndefined(), "Should be undefined!");
 
   mHaveResultOrErrorCode = true;
 
   nsresult rv = aHelper->GetResultCode();
 
   // If the request failed then set the error code and return.
   if (NS_FAILED(rv)) {
     SetError(rv);
@@ -220,17 +220,17 @@ IDBRequest::NotifyHelperCompleted(Helper
   return rv;
 }
 
 void
 IDBRequest::NotifyHelperSentResultsToChildProcess(nsresult aRv)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
   NS_ASSERTION(!mHaveResultOrErrorCode, "Already called!");
-  NS_ASSERTION(JSVAL_IS_VOID(mResultVal), "Should be undefined!");
+  NS_ASSERTION(mResultVal.isUndefined(), "Should be undefined!");
 
   // See if our window is still valid. If not then we're going to pretend that
   // we never completed.
   if (NS_FAILED(CheckInnerWindowCorrectness())) {
     return;
   }
 
   mHaveResultOrErrorCode = true;
--- a/dom/indexedDB/KeyPath.cpp
+++ b/dom/indexedDB/KeyPath.cpp
@@ -296,17 +296,17 @@ KeyPath::Parse(JSContext* aCx, const JS:
       }
 
       if (!keyPath.AppendStringWithValidation(aCx, str)) {
         return NS_ERROR_FAILURE;
       }
     }
   }
   // Otherwise convert it to a string.
-  else if (!aValue.isNull() && !JSVAL_IS_VOID(aValue)) {
+  else if (!aValue.isNull() && !aValue.isUndefined()) {
     JSString* jsstr;
     nsDependentJSString str;
     if (!(jsstr = JS::ToString(aCx, aValue)) ||
         !str.init(aCx, jsstr)) {
       return NS_ERROR_FAILURE;
     }
 
     keyPath.SetType(STRING);
@@ -430,17 +430,17 @@ KeyPath::ExtractOrCreateKey(JSContext* a
                                           CreateProperties, aCallback,
                                           aClosure);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   if (NS_FAILED(aKey.AppendItem(aCx, false, value))) {
     NS_ASSERTION(aKey.IsUnset(), "Should be unset");
-    return JSVAL_IS_VOID(value) ? NS_OK : NS_ERROR_DOM_INDEXEDDB_DATA_ERR;
+    return value.isUndefined() ? NS_OK : NS_ERROR_DOM_INDEXEDDB_DATA_ERR;
   }
 
   aKey.FinishArray();
 
   return NS_OK;
 }
 
 void
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -1251,26 +1251,26 @@ EventRunnable::WorkerRun(JSContext* aCx,
 
   nsAutoPtr<XMLHttpRequest::StateData> state(new XMLHttpRequest::StateData());
   StateDataAutoRooter rooter(aCx, state);
 
   state->mResponseTextResult = mResponseTextResult;
   state->mResponseText = mResponseText;
 
   if (NS_SUCCEEDED(mResponseTextResult)) {
-    MOZ_ASSERT(JSVAL_IS_VOID(mResponse) || mResponse.isNull());
+    MOZ_ASSERT(mResponse.isUndefined() || mResponse.isNull());
     state->mResponseResult = mResponseTextResult;
     state->mResponse = mResponse;
   }
   else {
     state->mResponseResult = mResponseResult;
 
     if (NS_SUCCEEDED(mResponseResult)) {
       if (mResponseBuffer.data()) {
-        MOZ_ASSERT(JSVAL_IS_VOID(mResponse));
+        MOZ_ASSERT(mResponse.isUndefined());
 
         JSAutoStructuredCloneBuffer responseBuffer(Move(mResponseBuffer));
 
         JSStructuredCloneCallbacks* callbacks =
           aWorkerPrivate->IsChromeWorker() ?
           ChromeWorkerStructuredCloneCallbacks(false) :
           WorkerStructuredCloneCallbacks(false);
 
@@ -2253,17 +2253,17 @@ XMLHttpRequest::SetResponseType(XMLHttpR
 
   mResponseType = ConvertStringToResponseType(acceptedResponseTypeString);
 }
 
 jsval
 XMLHttpRequest::GetResponse(JSContext* /* unused */, ErrorResult& aRv)
 {
   if (NS_SUCCEEDED(mStateData.mResponseTextResult) &&
-      JSVAL_IS_VOID(mStateData.mResponse)) {
+      mStateData.mResponse.isUndefined()) {
     MOZ_ASSERT(mStateData.mResponseText.Length());
     MOZ_ASSERT(NS_SUCCEEDED(mStateData.mResponseResult));
 
     JSString* str =
       JS_NewUCStringCopyN(mWorkerPrivate->GetJSContext(),
                           mStateData.mResponseText.get(),
                           mStateData.mResponseText.Length());
     if (!str) {
--- a/js/jsd/jsd_val.cpp
+++ b/js/jsd/jsd_val.cpp
@@ -97,17 +97,17 @@ bool
 jsd_IsValueNull(JSDContext* jsdc, JSDValue* jsdval)
 {
     return jsdval->val.isNull();
 }
 
 bool
 jsd_IsValueVoid(JSDContext* jsdc, JSDValue* jsdval)
 {
-    return JSVAL_IS_VOID(jsdval->val);
+    return jsdval->val.isUndefined();
 }
 
 bool
 jsd_IsValuePrimitive(JSDContext* jsdc, JSDValue* jsdval)
 {
     return JSVAL_IS_PRIMITIVE(jsdval->val);
 }
 
--- a/js/jsd/jsd_xpc.cpp
+++ b/js/jsd/jsd_xpc.cpp
@@ -2163,17 +2163,17 @@ jsdValue::GetJsType (uint32_t *_rval)
     else if (JSVAL_IS_BOOLEAN(val))
         *_rval = TYPE_BOOLEAN;
     else if (JSVAL_IS_DOUBLE(val))
         *_rval = TYPE_DOUBLE;
     else if (JSVAL_IS_INT(val))
         *_rval = TYPE_INT;
     else if (JSVAL_IS_STRING(val))
         *_rval = TYPE_STRING;
-    else if (JSVAL_IS_VOID(val))
+    else if (val.isUndefined())
         *_rval = TYPE_VOID;
     else if (JSD_IsValueFunction (mCx, mValue))
         *_rval = TYPE_FUNCTION;
     else if (!JSVAL_IS_PRIMITIVE(val))
         *_rval = TYPE_OBJECT;
     else
         NS_ASSERTION (0, "Value has no discernible type.");
 
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -1817,22 +1817,16 @@ static_assert(sizeof(LayoutAlignmentTest
 typedef JS::Value jsval;
 
 static_assert(sizeof(jsval_layout) == sizeof(JS::Value),
               "jsval_layout and JS::Value must have identical layouts");
 
 /************************************************************************/
 
 static inline bool
-JSVAL_IS_VOID(jsval v)
-{
-    return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v));
-}
-
-static inline bool
 JSVAL_IS_INT(jsval v)
 {
     return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v));
 }
 
 static inline int32_t
 JSVAL_TO_INT(jsval v)
 {
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -1281,17 +1281,17 @@ IsCTypesGlobal(HandleValue v)
 
 // Get the JSCTypesCallbacks struct from the 'ctypes' object 'obj'.
 JSCTypesCallbacks*
 GetCallbacks(JSObject* obj)
 {
   JS_ASSERT(IsCTypesGlobal(obj));
 
   jsval result = JS_GetReservedSlot(obj, SLOT_CALLBACKS);
-  if (JSVAL_IS_VOID(result))
+  if (result.isUndefined())
     return nullptr;
 
   return static_cast<JSCTypesCallbacks*>(JSVAL_TO_PRIVATE(result));
 }
 
 // Utility function to access a property of an object as an object
 // returns false and sets the error if the property does not exist
 // or is not an object
@@ -1379,20 +1379,20 @@ namespace js {
 JS_FRIEND_API(size_t)
 SizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj)
 {
     if (!CData::IsCData(obj))
         return 0;
 
     size_t n = 0;
     jsval slot = JS_GetReservedSlot(obj, ctypes::SLOT_OWNS);
-    if (!JSVAL_IS_VOID(slot)) {
+    if (!slot.isUndefined()) {
         bool owns = JSVAL_TO_BOOLEAN(slot);
         slot = JS_GetReservedSlot(obj, ctypes::SLOT_DATA);
-        if (!JSVAL_IS_VOID(slot)) {
+        if (!slot.isUndefined()) {
             char** buffer = static_cast<char**>(JSVAL_TO_PRIVATE(slot));
             n += mallocSizeOf(buffer);
             if (owns)
                 n += mallocSizeOf(*buffer);
         }
     }
     return n;
 }
@@ -3287,43 +3287,43 @@ CType::DefineBuiltin(JSContext* cx,
   return typeObj;
 }
 
 void
 CType::Finalize(JSFreeOp *fop, JSObject* obj)
 {
   // Make sure our TypeCode slot is legit. If it's not, bail.
   jsval slot = JS_GetReservedSlot(obj, SLOT_TYPECODE);
-  if (JSVAL_IS_VOID(slot))
+  if (slot.isUndefined())
     return;
 
   // The contents of our slots depends on what kind of type we are.
   switch (TypeCode(JSVAL_TO_INT(slot))) {
   case TYPE_function: {
     // Free the FunctionInfo.
     slot = JS_GetReservedSlot(obj, SLOT_FNINFO);
-    if (!JSVAL_IS_VOID(slot))
+    if (!slot.isUndefined())
       FreeOp::get(fop)->delete_(static_cast<FunctionInfo*>(JSVAL_TO_PRIVATE(slot)));
     break;
   }
 
   case TYPE_struct: {
     // Free the FieldInfoHash table.
     slot = JS_GetReservedSlot(obj, SLOT_FIELDINFO);
-    if (!JSVAL_IS_VOID(slot)) {
+    if (!slot.isUndefined()) {
       void* info = JSVAL_TO_PRIVATE(slot);
       FreeOp::get(fop)->delete_(static_cast<FieldInfoHash*>(info));
     }
   }
 
     // Fall through.
   case TYPE_array: {
     // Free the ffi_type info.
     slot = JS_GetReservedSlot(obj, SLOT_FFITYPE);
-    if (!JSVAL_IS_VOID(slot)) {
+    if (!slot.isUndefined()) {
       ffi_type* ffiType = static_cast<ffi_type*>(JSVAL_TO_PRIVATE(slot));
       FreeOp::get(fop)->free_(ffiType->elements);
       FreeOp::get(fop)->delete_(ffiType);
     }
 
     break;
   }
   default:
@@ -3332,24 +3332,24 @@ CType::Finalize(JSFreeOp *fop, JSObject*
   }
 }
 
 void
 CType::Trace(JSTracer* trc, JSObject* obj)
 {
   // Make sure our TypeCode slot is legit. If it's not, bail.
   jsval slot = obj->getSlot(SLOT_TYPECODE);
-  if (JSVAL_IS_VOID(slot))
+  if (slot.isUndefined())
     return;
 
   // The contents of our slots depends on what kind of type we are.
   switch (TypeCode(JSVAL_TO_INT(slot))) {
   case TYPE_struct: {
     slot = obj->getReservedSlot(SLOT_FIELDINFO);
-    if (JSVAL_IS_VOID(slot))
+    if (slot.isUndefined())
       return;
 
     FieldInfoHash* fields =
       static_cast<FieldInfoHash*>(JSVAL_TO_PRIVATE(slot));
     for (FieldInfoHash::Enum e(*fields); !e.empty(); e.popFront()) {
       JSString *key = e.front().key();
       JS_CallStringTracer(trc, &key, "fieldName");
       if (key != e.front().key())
@@ -3357,17 +3357,17 @@ CType::Trace(JSTracer* trc, JSObject* ob
       JS_CallHeapObjectTracer(trc, &e.front().value().mType, "fieldType");
     }
 
     break;
   }
   case TYPE_function: {
     // Check if we have a FunctionInfo.
     slot = obj->getReservedSlot(SLOT_FNINFO);
-    if (JSVAL_IS_VOID(slot))
+    if (slot.isUndefined())
       return;
 
     FunctionInfo* fninfo = static_cast<FunctionInfo*>(JSVAL_TO_PRIVATE(slot));
     JS_ASSERT(fninfo);
 
     // Identify our objects to the tracer.
     JS_CallHeapObjectTracer(trc, &fninfo->mABI, "abi");
     JS_CallHeapObjectTracer(trc, &fninfo->mReturnType, "returnType");
@@ -3485,28 +3485,28 @@ CType::GetSafeSize(JSObject* obj, size_t
     *result = JSVAL_TO_INT(size);
     return true;
   }
   if (JSVAL_IS_DOUBLE(size)) {
     *result = Convert<size_t>(JSVAL_TO_DOUBLE(size));
     return true;
   }
 
-  JS_ASSERT(JSVAL_IS_VOID(size));
+  JS_ASSERT(size.isUndefined());
   return false;
 }
 
 size_t
 CType::GetSize(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
 
   jsval size = JS_GetReservedSlot(obj, SLOT_SIZE);
 
-  JS_ASSERT(!JSVAL_IS_VOID(size));
+  JS_ASSERT(!size.isUndefined());
 
   // The "size" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   // For callers who know it can never be JSVAL_VOID, return a size_t directly.
   if (JSVAL_IS_INT(size))
     return JSVAL_TO_INT(size);
   return Convert<size_t>(JSVAL_TO_DOUBLE(size));
 }
@@ -3515,18 +3515,18 @@ bool
 CType::IsSizeDefined(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
 
   jsval size = JS_GetReservedSlot(obj, SLOT_SIZE);
 
   // The "size" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
-  JS_ASSERT(JSVAL_IS_INT(size) || JSVAL_IS_DOUBLE(size) || JSVAL_IS_VOID(size));
-  return !JSVAL_IS_VOID(size);
+  JS_ASSERT(JSVAL_IS_INT(size) || JSVAL_IS_DOUBLE(size) || size.isUndefined());
+  return !size.isUndefined();
 }
 
 size_t
 CType::GetAlignment(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_ALIGN);
@@ -3535,17 +3535,17 @@ CType::GetAlignment(JSObject* obj)
 
 ffi_type*
 CType::GetFFIType(JSContext* cx, JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_FFITYPE);
 
-  if (!JSVAL_IS_VOID(slot)) {
+  if (!slot.isUndefined()) {
     return static_cast<ffi_type*>(JSVAL_TO_PRIVATE(slot));
   }
 
   AutoPtr<ffi_type> result;
   switch (CType::GetTypeCode(obj)) {
   case TYPE_array:
     result = ArrayType::BuildFFIType(cx, obj);
     break;
@@ -3565,17 +3565,17 @@ CType::GetFFIType(JSContext* cx, JSObjec
 }
 
 JSString*
 CType::GetName(JSContext* cx, HandleObject obj)
 {
   JS_ASSERT(CType::IsCType(obj));
 
   jsval string = JS_GetReservedSlot(obj, SLOT_NAME);
-  if (!JSVAL_IS_VOID(string))
+  if (!string.isUndefined())
     return JSVAL_TO_STRING(string);
 
   // Build the type name lazily.
   JSString* name = BuildTypeName(cx, obj);
   if (!name)
     return nullptr;
   JS_SetReservedSlot(obj, SLOT_NAME, STRING_TO_JSVAL(name));
   return name;
@@ -5089,17 +5089,17 @@ StructType::ConstructData(JSContext* cx,
 
 const FieldInfoHash*
 StructType::GetFieldInfo(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
   JS_ASSERT(CType::GetTypeCode(obj) == TYPE_struct);
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_FIELDINFO);
-  JS_ASSERT(!JSVAL_IS_VOID(slot) && JSVAL_TO_PRIVATE(slot));
+  JS_ASSERT(!slot.isUndefined() && JSVAL_TO_PRIVATE(slot));
 
   return static_cast<const FieldInfoHash*>(JSVAL_TO_PRIVATE(slot));
 }
 
 const FieldInfo*
 StructType::LookupField(JSContext* cx, JSObject* obj, JSFlatString *name)
 {
   JS_ASSERT(CType::IsCType(obj));
@@ -5907,17 +5907,17 @@ FunctionType::Call(JSContext* cx,
 
 FunctionInfo*
 FunctionType::GetFunctionInfo(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
   JS_ASSERT(CType::GetTypeCode(obj) == TYPE_function);
 
   jsval slot = JS_GetReservedSlot(obj, SLOT_FNINFO);
-  JS_ASSERT(!JSVAL_IS_VOID(slot) && JSVAL_TO_PRIVATE(slot));
+  JS_ASSERT(!slot.isUndefined() && JSVAL_TO_PRIVATE(slot));
 
   return static_cast<FunctionInfo*>(JSVAL_TO_PRIVATE(slot));
 }
 
 bool
 FunctionType::IsFunctionType(HandleValue v)
 {
   if (!v.isObject())
@@ -6025,17 +6025,17 @@ CClosure::Create(JSContext* cx,
 
   // Get a JSContext for use with the closure.
   cinfo->cx = js::DefaultJSContext(JS_GetRuntime(cx));
 
   // Prepare the error sentinel value. It's important to do this now, because
   // we might be unable to convert the value to the proper type. If so, we want
   // the caller to know about it _now_, rather than some uncertain time in the
   // future when the error sentinel is actually needed.
-  if (!JSVAL_IS_VOID(errVal)) {
+  if (!errVal.isUndefined()) {
 
     // Make sure the callback returns something.
     if (CType::GetTypeCode(fninfo->mReturnType) == TYPE_void_t) {
       JS_ReportError(cx, "A void callback can't pass an error sentinel");
       return nullptr;
     }
 
     // With the exception of void, the FunctionType constructor ensures that
@@ -6087,17 +6087,17 @@ CClosure::Create(JSContext* cx,
   return result;
 }
 
 void
 CClosure::Trace(JSTracer* trc, JSObject* obj)
 {
   // Make sure our ClosureInfo slot is legit. If it's not, bail.
   jsval slot = JS_GetReservedSlot(obj, SLOT_CLOSUREINFO);
-  if (JSVAL_IS_VOID(slot))
+  if (slot.isUndefined())
     return;
 
   ClosureInfo* cinfo = static_cast<ClosureInfo*>(JSVAL_TO_PRIVATE(slot));
 
   // Identify our objects to the tracer. (There's no need to identify
   // 'closureObj', since that's us.)
   JS_CallHeapObjectTracer(trc, &cinfo->typeObj, "typeObj");
   JS_CallHeapObjectTracer(trc, &cinfo->jsfnObj, "jsfnObj");
@@ -6105,17 +6105,17 @@ CClosure::Trace(JSTracer* trc, JSObject*
     JS_CallHeapObjectTracer(trc, &cinfo->thisObj, "thisObj");
 }
 
 void
 CClosure::Finalize(JSFreeOp *fop, JSObject* obj)
 {
   // Make sure our ClosureInfo slot is legit. If it's not, bail.
   jsval slot = JS_GetReservedSlot(obj, SLOT_CLOSUREINFO);
-  if (JSVAL_IS_VOID(slot))
+  if (slot.isUndefined())
     return;
 
   ClosureInfo* cinfo = static_cast<ClosureInfo*>(JSVAL_TO_PRIVATE(slot));
   FreeOp::get(fop)->delete_(cinfo);
 }
 
 void
 CClosure::ClosureStub(ffi_cif* cif, void* result, void** args, void* userData)
@@ -6349,23 +6349,23 @@ CData::Create(JSContext* cx,
   return dataObj;
 }
 
 void
 CData::Finalize(JSFreeOp *fop, JSObject* obj)
 {
   // Delete our buffer, and the data it contains if we own it.
   jsval slot = JS_GetReservedSlot(obj, SLOT_OWNS);
-  if (JSVAL_IS_VOID(slot))
+  if (slot.isUndefined())
     return;
 
   bool owns = JSVAL_TO_BOOLEAN(slot);
 
   slot = JS_GetReservedSlot(obj, SLOT_DATA);
-  if (JSVAL_IS_VOID(slot))
+  if (slot.isUndefined())
     return;
   char** buffer = static_cast<char**>(JSVAL_TO_PRIVATE(slot));
 
   if (owns)
     FreeOp::get(fop)->free_(*buffer);
   FreeOp::get(fop)->delete_(buffer);
 }
 
@@ -6808,17 +6808,17 @@ CDataFinalizer::IsCDataFinalizer(JSObjec
 
 JSObject *
 CDataFinalizer::GetCType(JSContext *cx, JSObject *obj)
 {
   MOZ_ASSERT(IsCDataFinalizer(obj));
 
   jsval valData = JS_GetReservedSlot(obj,
                                      SLOT_DATAFINALIZER_VALTYPE);
-  if (JSVAL_IS_VOID(valData)) {
+  if (valData.isUndefined()) {
     return nullptr;
   }
 
   return JSVAL_TO_OBJECT(valData);
 }
 
 JSObject*
 CDataFinalizer::GetCData(JSContext *cx, JSObject *obj)
@@ -7301,17 +7301,17 @@ Int64Base::Construct(JSContext* cx,
 
   return result;
 }
 
 void
 Int64Base::Finalize(JSFreeOp *fop, JSObject* obj)
 {
   jsval slot = JS_GetReservedSlot(obj, SLOT_INT64);
-  if (JSVAL_IS_VOID(slot))
+  if (slot.isUndefined())
     return;
 
   FreeOp::get(fop)->delete_(static_cast<uint64_t*>(JSVAL_TO_PRIVATE(slot)));
 }
 
 uint64_t
 Int64Base::GetInt(JSObject* obj) {
   JS_ASSERT(Int64::IsInt64(obj) || UInt64::IsUInt64(obj));
--- a/js/src/jsapi-tests/testResolveRecursion.cpp
+++ b/js/src/jsapi-tests/testResolveRecursion.cpp
@@ -105,32 +105,32 @@ doResolve(JS::HandleObject obj, JS::Hand
             objp.set(nullptr);
             return true;
         }
     } else if (JS_FlatStringEqualsAscii(str, "y")) {
         if (obj == obj2) {
             CHECK_EQUAL(resolveEntryCount, 2);
             CHECK(JS_DefinePropertyById(cx, obj, id, JSVAL_NULL, nullptr, nullptr, 0));
             EVAL("obj1.x", &v);
-            CHECK(JSVAL_IS_VOID(v));
+            CHECK(v.isUndefined());
             EVAL("obj1.y", &v);
             CHECK_SAME(v, JSVAL_ZERO);
             objp.set(obj);
             return true;
         }
         if (obj == obj1) {
             CHECK_EQUAL(resolveEntryCount, 3);
             EVAL("obj1.x", &v);
-            CHECK(JSVAL_IS_VOID(v));
+            CHECK(v.isUndefined());
             EVAL("obj1.y", &v);
-            CHECK(JSVAL_IS_VOID(v));
+            CHECK(v.isUndefined());
             EVAL("obj2.y", &v);
             CHECK(v.isNull());
             EVAL("obj2.x", &v);
-            CHECK(JSVAL_IS_VOID(v));
+            CHECK(v.isUndefined());
             EVAL("obj1.y = 0", &v);
             CHECK_SAME(v, JSVAL_ZERO);
             objp.set(obj);
             return true;
         }
     }
     CHECK(false);
     return false;
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -539,17 +539,17 @@ js::ReportUsageError(JSContext *cx, Hand
     JS_ASSERT(!shape->configurable());
     JS_ASSERT(!shape->writable());
     JS_ASSERT(shape->hasDefaultGetter());
 
     RootedValue usage(cx);
     if (!JS_LookupProperty(cx, callee, "usage", &usage))
         return;
 
-    if (JSVAL_IS_VOID(usage)) {
+    if (usage.isUndefined()) {
         JS_ReportError(cx, "%s", msg);
     } else {
         JSString *str = JSVAL_TO_STRING(usage);
         JS::Anchor<JSString *> a_str(str);
         const jschar *chars = JS_GetStringCharsZ(cx, str);
         if (!chars)
             return;
         JS_ReportError(cx, "%s. Usage: %hs", msg, chars);
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -596,17 +596,17 @@ Process(JSContext *cx, JSObject *obj_, c
     }
 }
 
 static bool
 Version(JSContext *cx, unsigned argc, jsval *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     JSVersion origVersion = JS_GetVersion(cx);
-    if (args.length() == 0 || JSVAL_IS_VOID(args[0])) {
+    if (args.length() == 0 || args[0].isUndefined()) {
         /* Get version. */
         args.rval().setInt32(origVersion);
     } else {
         /* Set version. */
         int32_t v = -1;
         if (args[0].isInt32()) {
             v = args[0].toInt32();
         } else if (args[0].isDouble()) {
@@ -4950,17 +4950,17 @@ PrintHelp(JSContext *cx, HandleObject ob
 {
     RootedValue usage(cx);
     if (!JS_LookupProperty(cx, obj, "usage", &usage))
         return false;
     RootedValue help(cx);
     if (!JS_LookupProperty(cx, obj, "help", &help))
         return false;
 
-    if (JSVAL_IS_VOID(usage) || JSVAL_IS_VOID(help))
+    if (usage.isUndefined() || help.isUndefined())
         return true;
 
     return PrintHelpString(cx, usage) && PrintHelpString(cx, help);
 }
 
 static bool
 Help(JSContext *cx, unsigned argc, jsval *vp)
 {
--- a/js/src/shell/jsheaptools.cpp
+++ b/js/src/shell/jsheaptools.cpp
@@ -427,17 +427,17 @@ ReferenceFinder::visit(void *cell, Path 
 
     HeapReverser::Map::Ptr p = reverser.map.lookup(cell);
     JS_ASSERT(p);
     HeapReverser::Node *node = &p->value();
 
     /* Is |cell| a representable cell, reached via a non-empty path? */
     if (path != nullptr) {
         jsval representation = representable(cell, node->kind);
-        if (!JSVAL_IS_VOID(representation))
+        if (!representation.isUndefined())
             return addReferrer(representation, path);
     }
 
     /*
      * If we've made a cycle, don't traverse further. We *do* want to include
      * paths from the target to itself, so we don't want to do this check until
      * after we've possibly reported this cell as a referrer.
      */
--- a/js/src/tests/js1_5/Regress/regress-355829-01.js
+++ b/js/src/tests/js1_5/Regress/regress-355829-01.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 355829;
-var summary = 'Do not assert: !argc || argv[0].isNull() || JSVAL_IS_VOID(argv[0])';
+var summary = 'Do not assert: !argc || argv[0].isNull() || argv[0].isUndefined()';
 var actual = '';
 var expect = '';
 
 
 //-----------------------------------------------------------------------------
 test();
 //-----------------------------------------------------------------------------
 
--- a/js/src/tests/js1_5/Regress/regress-452573-01.js
+++ b/js/src/tests/js1_5/Regress/regress-452573-01.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 452573;
-var summary = 'Do not assert with JIT: JSVAL_IS_VOID(boxed) || JSVAL_IS_BOOLEAN(boxed)';
+var summary = 'Do not assert with JIT: boxed.isUndefined() || JSVAL_IS_BOOLEAN(boxed)';
 var actual = 'No Crash';
 var expect = 'No Crash';
 
 //-----------------------------------------------------------------------------
 test();
 //-----------------------------------------------------------------------------
 
 function test()
--- a/js/src/tests/js1_5/Regress/regress-453747.js
+++ b/js/src/tests/js1_5/Regress/regress-453747.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 453747;
-var summary = 'Do not assert with JIT: JSVAL_IS_VOID(boxed) || JSVAL_IS_BOOLEAN(boxed)';
+var summary = 'Do not assert with JIT: boxed.isUndefined() || JSVAL_IS_BOOLEAN(boxed)';
 var actual = 'No Crash';
 var expect = 'No Crash';
 
 //-----------------------------------------------------------------------------
 test();
 //-----------------------------------------------------------------------------
 
 function test()
--- a/js/src/tests/js1_5/Regress/regress-459628.js
+++ b/js/src/tests/js1_5/Regress/regress-459628.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 //-----------------------------------------------------------------------------
 var BUGNUMBER = 459628;
-var summary = 'Do not assert: JSVAL_IS_VOID(STOBJ_GET_SLOT(obj, map->freeslot))';
+var summary = 'Do not assert: STOBJ_GET_SLOT(obj, map->freeslot).isUndefined()';
 var actual = '';
 var expect = '';
 
 
 //-----------------------------------------------------------------------------
 test();
 //-----------------------------------------------------------------------------
 
--- a/js/src/vm/StructuredClone.cpp
+++ b/js/src/vm/StructuredClone.cpp
@@ -714,17 +714,17 @@ JSStructuredCloneWriter::~JSStructuredCl
     ClearStructuredClone(data, size, callbacks, closure);
 }
 
 bool
 JSStructuredCloneWriter::parseTransferable()
 {
     MOZ_ASSERT(transferableObjects.empty(), "parseTransferable called with stale data");
 
-    if (transferable.isNull() || JSVAL_IS_VOID(transferable))
+    if (transferable.isNull() || transferable.isUndefined())
         return true;
 
     if (!transferable.isObject())
         return reportErrorTransferable();
 
     JSContext *cx = context();
     RootedObject array(cx, &transferable.toObject());
     if (!JS_IsArrayObject(cx, array))
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -466,17 +466,17 @@ mozJSComponentLoader::LoadModule(FileLoc
     if (!file_jsobj) {
         return nullptr;
     }
 
     JSCLAutoErrorReporterSetter aers(cx, xpc::SystemErrorReporter);
 
     RootedValue NSGetFactory_val(cx);
     if (!JS_GetProperty(cx, entryObj, "NSGetFactory", &NSGetFactory_val) ||
-        JSVAL_IS_VOID(NSGetFactory_val)) {
+        NSGetFactory_val.isUndefined()) {
         return nullptr;
     }
 
     if (JS_TypeOfValue(cx, NSGetFactory_val) != JSTYPE_FUNCTION) {
         nsAutoCString spec;
         uri->GetSpec(spec);
         JS_ReportError(cx, "%s has NSGetFactory property that is not a function",
                        spec.get());
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -468,17 +468,17 @@ XPCConvert::JSData2Native(void* d, Handl
             return false;
         }
         *((const nsID**)d) = pid;
         return true;
     }
 
     case nsXPTType::T_ASTRING:
     {
-        if (JSVAL_IS_VOID(s)) {
+        if (s.isUndefined()) {
             if (useAllocator)
                 *((const nsAString**)d) = &NullString();
             else
                 (**((nsAString**)d)).SetIsVoid(true);
             return true;
         }
         // Fall through to T_DOMSTRING case.
     }
@@ -489,17 +489,17 @@ XPCConvert::JSData2Native(void* d, Handl
                 *((const nsAString**)d) = &NullString();
             else
                 (**((nsAString**)d)).SetIsVoid(true);
             return true;
         }
         size_t length = 0;
         const char16_t* chars = nullptr;
         JSString* str = nullptr;
-        if (!JSVAL_IS_VOID(s)) {
+        if (!s.isUndefined()) {
             str = ToString(cx, s);
             if (!str)
                 return false;
 
             chars = useAllocator ? JS_GetStringCharsZAndLength(cx, str, &length)
                                  : JS_GetStringCharsAndLength(cx, str, &length);
             if (!chars)
                 return false;
@@ -538,17 +538,17 @@ XPCConvert::JSData2Native(void* d, Handl
         } else {
             ws->Assign(chars, length);
         }
         return true;
     }
 
     case nsXPTType::T_CHAR_STR:
     {
-        if (JSVAL_IS_VOID(s) || s.isNull()) {
+        if (s.isUndefined() || s.isNull()) {
             *((char**)d) = nullptr;
             return true;
         }
 
         JSString* str = ToString(cx, s);
         if (!str) {
             return false;
         }
@@ -579,17 +579,17 @@ XPCConvert::JSData2Native(void* d, Handl
         return true;
     }
 
     case nsXPTType::T_WCHAR_STR:
     {
         const jschar* chars=nullptr;
         JSString* str;
 
-        if (JSVAL_IS_VOID(s) || s.isNull()) {
+        if (s.isUndefined() || s.isNull()) {
             *((jschar**)d) = nullptr;
             return true;
         }
 
         if (!(str = ToString(cx, s))) {
             return false;
         }
         if (!(chars = JS_GetStringCharsZ(cx, str))) {
@@ -609,17 +609,17 @@ XPCConvert::JSData2Native(void* d, Handl
     }
 
     case nsXPTType::T_UTF8STRING:
     {
         const jschar* chars;
         size_t length;
         JSString* str;
 
-        if (s.isNull() || JSVAL_IS_VOID(s)) {
+        if (s.isNull() || s.isUndefined()) {
             if (useAllocator) {
                 *((const nsACString**)d) = &NullCString();
             } else {
                 nsCString* rs = *((nsCString**)d);
                 rs->SetIsVoid(true);
             }
             return true;
         }
@@ -653,17 +653,17 @@ XPCConvert::JSData2Native(void* d, Handl
             rs = *((nsCString**)d);
         }
         CopyUTF16toUTF8(Substring(chars, length), *rs);
         return true;
     }
 
     case nsXPTType::T_CSTRING:
     {
-        if (s.isNull() || JSVAL_IS_VOID(s)) {
+        if (s.isNull() || s.isUndefined()) {
             if (useAllocator) {
                 nsACString *rs = new nsCString();
                 if (!rs)
                     return false;
 
                 rs->SetIsVoid(true);
                 *((nsACString**)d) = rs;
             } else {
@@ -1206,17 +1206,17 @@ XPCConvert::JSValToXPCException(MutableH
                 return NS_ERROR_FAILURE;
 
             return ConstructException(NS_ERROR_XPC_JS_THREW_JS_OBJECT,
                                       strBytes.ptr(), ifaceName, methodName,
                                       nullptr, exceptn, cx, s.address());
         }
     }
 
-    if (JSVAL_IS_VOID(s) || s.isNull()) {
+    if (s.isUndefined() || s.isNull()) {
         return ConstructException(NS_ERROR_XPC_JS_THREW_NULL,
                                   nullptr, ifaceName, methodName, nullptr,
                                   exceptn, cx, s.address());
     }
 
     if (JSVAL_IS_NUMBER(s)) {
         // lets see if it looks like an nsresult
         nsresult rv;
@@ -1766,17 +1766,17 @@ XPCConvert::JSStringWithSize2Native(void
     uint32_t len;
 
     if (pErr)
         *pErr = NS_ERROR_XPC_BAD_CONVERT_NATIVE;
 
     switch (type.TagPart()) {
         case nsXPTType::T_PSTRING_SIZE_IS:
         {
-            if (JSVAL_IS_VOID(s) || s.isNull()) {
+            if (s.isUndefined() || s.isNull()) {
                 if (0 != count) {
                     if (pErr)
                         *pErr = NS_ERROR_XPC_NOT_ENOUGH_CHARS_IN_STRING;
                     return false;
                 }
                 if (0 != count) {
                     len = (count + 1) * sizeof(char);
                     if (!(*((void**)d) = nsMemory::Alloc(len)))
@@ -1820,17 +1820,17 @@ XPCConvert::JSStringWithSize2Native(void
             return true;
         }
 
         case nsXPTType::T_PWSTRING_SIZE_IS:
         {
             const jschar* chars=nullptr;
             JSString* str;
 
-            if (JSVAL_IS_VOID(s) || s.isNull()) {
+            if (s.isUndefined() || s.isNull()) {
                 if (0 != count) {
                     if (pErr)
                         *pErr = NS_ERROR_XPC_NOT_ENOUGH_CHARS_IN_STRING;
                     return false;
                 }
 
                 if (0 != count) {
                     len = (count + 1) * sizeof(jschar);
--- a/js/xpconnect/src/XPCQuickStubs.h
+++ b/js/xpconnect/src/XPCQuickStubs.h
@@ -219,32 +219,32 @@ protected:
     bool mValid;
 
     /*
      * If null is returned, then we either failed or fully initialized
      * |this|; in either case the caller should return immediately
      * without doing anything else. Otherwise, the JSString* created
      * from |v| will be returned.  It'll be rooted, as needed, in
      * *pval.  nullBehavior and undefinedBehavior control what happens
-     * when v.isNull() and JSVAL_IS_VOID are respectively true.
+     * when v.isNull() and v.isUndefined() are respectively true.
      */
     template<class traits>
     JSString* InitOrStringify(JSContext* cx, JS::HandleValue v,
                               JS::MutableHandleValue pval,
                               bool notpassed,
                               StringificationBehavior nullBehavior,
                               StringificationBehavior undefinedBehavior) {
         JSString *s;
         if (JSVAL_IS_STRING(v)) {
             s = JSVAL_TO_STRING(v);
         } else {
             StringificationBehavior behavior = eStringify;
             if (v.isNull()) {
                 behavior = nullBehavior;
-            } else if (JSVAL_IS_VOID(v)) {
+            } else if (v.isUndefined()) {
                 behavior = undefinedBehavior;
             }
 
             // If pval is null, that means the argument was optional and
             // not passed; turn those into void strings if they're
             // supposed to be stringified.
             if (behavior != eStringify || notpassed) {
                 // Here behavior == eStringify implies notpassed, so both eNull and
--- a/toolkit/components/places/History.cpp
+++ b/toolkit/components/places/History.cpp
@@ -310,17 +310,17 @@ GetURIFromJSObject(JSContext* aCtx,
  *        The JS value to convert.
  * @param _string
  *        The string to populate with the value, or set it to void.
  */
 void
 GetJSValueAsString(JSContext* aCtx,
                    const JS::Value& aValue,
                    nsString& _string) {
-  if (JSVAL_IS_VOID(aValue) ||
+  if (aValue.isUndefined() ||
       !(aValue.isNull() || JSVAL_IS_STRING(aValue))) {
     _string.SetIsVoid(true);
     return;
   }
 
   // |null| in JS maps to the empty string.
   if (aValue.isNull()) {
     _string.Truncate();
@@ -382,17 +382,17 @@ nsresult
 GetIntFromJSObject(JSContext* aCtx,
                    JS::Handle<JSObject *> aObject,
                    const char* aProperty,
                    IntType* _int)
 {
   JS::Rooted<JS::Value> value(aCtx);
   bool rc = JS_GetProperty(aCtx, aObject, aProperty, &value);
   NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED);
-  if (JSVAL_IS_VOID(value)) {
+  if (value.isUndefined()) {
     return NS_ERROR_INVALID_ARG;
   }
   NS_ENSURE_ARG(JSVAL_IS_PRIMITIVE(value));
   NS_ENSURE_ARG(JSVAL_IS_NUMBER(value));
 
   double num;
   rc = JS::ToNumber(aCtx, value, &num);
   NS_ENSURE_TRUE(rc, NS_ERROR_UNEXPECTED);