Bug 585152 - Reland Date.now() fractional changes, along with fixed tests. (r=jwalden,dolske,gavin, rs=jwalden)
For the tests, I put a Math.floor around anything which looked like it did string concatenation. In principal that was r+ by dolske and gavin, and jwalden r+ed the extension to the rest of the tests. Backout policy: the jsdate.cpp changes can be backed out trivially. The test changes should backout cleanly, but we're not hosed if they don't.
This commit is contained in:
@@ -1189,10 +1189,16 @@ NowAsMillis()
|
||||
return (jsdouble) (PRMJ_Now() / PRMJ_USEC_PER_MSEC);
|
||||
}
|
||||
|
||||
static inline jsdouble
|
||||
NowAsFractionalsMillis()
|
||||
{
|
||||
return (jsdouble) (PRMJ_Now() / double(PRMJ_USEC_PER_MSEC));
|
||||
}
|
||||
|
||||
static JSBool
|
||||
date_now(JSContext *cx, uintN argc, Value *vp)
|
||||
{
|
||||
vp->setDouble(NowAsMillis());
|
||||
vp->setDouble(NowAsFractionalsMillis());
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
@@ -1200,7 +1206,7 @@ date_now(JSContext *cx, uintN argc, Value *vp)
|
||||
static jsdouble FASTCALL
|
||||
date_now_tn(JSContext*)
|
||||
{
|
||||
return NowAsMillis();
|
||||
return NowAsFractionalsMillis();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user