Add JS_NewDateObject, JS_NewDateObjectMsec, JS_ObjectIsDate to the JSAPI. Bug 625870, r=jorendorff, a=shaver.

This commit is contained in:
Andrew Paprocki 2011-01-18 16:11:03 -06:00
parent c00a120cc9
commit f73f9bb25a
2 changed files with 44 additions and 0 deletions

View File

@ -5706,6 +5706,32 @@ JS_SetErrorReporter(JSContext *cx, JSErrorReporter er)
/************************************************************************/
/*
* Dates.
*/
JS_PUBLIC_API(JSObject *)
JS_NewDateObject(JSContext *cx, int year, int mon, int mday, int hour, int min, int sec)
{
CHECK_REQUEST(cx);
return js_NewDateObject(cx, year, mon, mday, hour, min, sec);
}
JS_PUBLIC_API(JSObject *)
JS_NewDateObjectMsec(JSContext *cx, jsdouble msec)
{
CHECK_REQUEST(cx);
return js_NewDateObjectMsec(cx, msec);
}
JS_PUBLIC_API(JSBool)
JS_ObjectIsDate(JSContext *cx, JSObject *obj)
{
JS_ASSERT(obj);
return obj->isDate();
}
/************************************************************************/
/*
* Regular Expressions.
*/

View File

@ -3596,6 +3596,24 @@ JS_SetErrorReporter(JSContext *cx, JSErrorReporter er);
/************************************************************************/
/*
* Dates.
*/
extern JS_PUBLIC_API(JSObject *)
JS_NewDateObject(JSContext *cx, int year, int mon, int mday, int hour, int min, int sec);
extern JS_PUBLIC_API(JSObject *)
JS_NewDateObjectMsec(JSContext *cx, jsdouble msec);
/*
* Infallible predicate to test whether obj is a date object.
*/
extern JS_PUBLIC_API(JSBool)
JS_ObjectIsDate(JSContext *cx, JSObject *obj);
/************************************************************************/
/*
* Regular Expressions.
*/