Bug 793076 (part 6) - Remove SetDateToNaN. r=jwalden.
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 07 Oct 2012 18:01:51 -0700
changeset 109599 0a0f23cf7a7a7dbb8b5f8e37d1abc813a69f2f57
parent 109598 2c7698ae61949c8e17281c4fa0bbba3afaee2b3b
child 109600 99229a1bf7eab4a9da02a4b2292d8cad17cfaea0
push id23636
push usergsharp@mozilla.com
push dateMon, 08 Oct 2012 08:08:19 +0000
treeherdermozilla-central@24cf40690042 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs793076
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 793076 (part 6) - Remove SetDateToNaN. r=jwalden.
js/src/jsdate.cpp
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -1275,22 +1275,16 @@ SetUTCTime(RawObject obj, double t, Valu
         obj->setSlot(ind, UndefinedValue());
     }
 
     obj->setDateUTCTime(DoubleValue(t));
     if (vp)
         vp->setDouble(t);
 }
 
-static void
-SetDateToNaN(RawObject obj, Value *vp = NULL)
-{
-    SetUTCTime(obj, js_NaN, vp);
-}
-
 /*
  * Cache the local time, year, month, and so forth of the object.
  * If UTC time is not finite (e.g., NaN), the local time
  * slots will be set to the UTC time without conversion.
  */
 static bool
 CacheLocalTime(DSTOffsetCache *dstOffsetCache, RawObject obj)
 {
@@ -1802,17 +1796,17 @@ date_getTimezoneOffset(JSContext *cx, un
 
 JS_ALWAYS_INLINE bool
 date_setTime_impl(JSContext *cx, CallArgs args)
 {
     JS_ASSERT(IsDate(args.thisv()));
 
     RootedObject thisObj(cx, &args.thisv().toObject());
     if (args.length() == 0) {
-        SetDateToNaN(thisObj, args.rval().address());
+        SetUTCTime(thisObj, js_NaN, args.rval().address());
         return true;
     }
 
     double result;
     if (!ToNumber(cx, args[0], &result))
         return false;
 
     SetUTCTime(thisObj, TimeClip(result), args.rval().address());
@@ -2467,17 +2461,17 @@ date_setYear_impl(JSContext *cx, CallArg
 
     /* Step 2. */
     double y;
     if (!ToNumber(cx, args.length() > 0 ? args[0] : UndefinedValue(), &y))
         return false;
 
     /* Step 3. */
     if (MOZ_DOUBLE_IS_NaN(y)) {
-        SetDateToNaN(thisObj, args.rval().address());
+        SetUTCTime(thisObj, js_NaN, args.rval().address());
         return true;
     }
 
     /* Step 4. */
     double yint = ToInteger(y);
     if (0 <= yint && yint <= 99)
         yint += 1900;
 
@@ -3167,17 +3161,17 @@ js_InitDateClass(JSContext *cx, HandleOb
 
     UpdateLocalTZA();
 
     Rooted<GlobalObject*> global(cx, &obj->asGlobal());
 
     RootedObject dateProto(cx, global->createBlankPrototype(cx, &DateClass));
     if (!dateProto)
         return NULL;
-    SetDateToNaN(dateProto);
+    SetUTCTime(dateProto, js_NaN);
 
     RootedFunction ctor(cx);
     ctor = global->createConstructor(cx, js_Date, cx->names().Date, MAXARGS);
     if (!ctor)
         return NULL;
 
     if (!LinkConstructorAndPrototype(cx, ctor, dateProto))
         return NULL;