Be careful when using setDouble that we shouldn't use setNumber instead to fit in an int when possible. Was missing a lot in jsdate.cpp

This commit is contained in:
Luke Wagner
2010-06-21 16:28:02 -07:00
parent 070848573c
commit 4808e8a1d1
4 changed files with 35 additions and 51 deletions

View File

@@ -3161,7 +3161,7 @@ JS_DefineConstDoubles(JSContext *cx, JSObject *obj, JSConstDoubleSpec *cds)
CHECK_REQUEST(cx);
for (ok = JS_TRUE; cds->name; cds++) {
Value value(DoubleTag(cds->dval));
Value value = DoubleTag(cds->dval);
attrs = cds->flags;
if (!attrs)
attrs = JSPROP_READONLY | JSPROP_PERMANENT;