mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Add JS_NewDateObject, JS_NewDateObjectMsec, JS_ObjectIsDate to the JSAPI. Bug 625870, r=jorendorff, a=shaver.
This commit is contained in:
parent
c00a120cc9
commit
f73f9bb25a
@ -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.
|
||||
*/
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user