Merge TM -> JM

This commit is contained in:
Brian Hackett
2011-07-01 16:24:32 -07:00
3560 changed files with 75386 additions and 110433 deletions

View File

@@ -489,6 +489,15 @@ msFromTime(jsdouble t)
* end of ECMA 'support' functions
*/
static JSBool
date_convert(JSContext *cx, JSObject *obj, JSType hint, Value *vp)
{
JS_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
JS_ASSERT(obj->isDate());
return DefaultValue(cx, obj, (hint == JSTYPE_VOID) ? JSTYPE_STRING : hint, vp);
}
/*
* Other Support routines and definitions
*/
@@ -503,7 +512,7 @@ Class js_DateClass = {
StrictPropertyStub, /* setProperty */
EnumerateStub,
ResolveStub,
ConvertStub
date_convert
};
/* for use by date_parse */
@@ -2085,8 +2094,8 @@ date_toJSON(JSContext *cx, uintN argc, Value *vp)
return false;
/* Step 2. */
Value &tv = vp[0];
if (!DefaultValue(cx, obj, JSTYPE_NUMBER, &tv))
Value tv = ObjectValue(*obj);
if (!ToPrimitive(cx, JSTYPE_NUMBER, &tv))
return false;
/* Step 3. */