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

This commit is contained in:
Andrew Paprocki 2011-01-18 12:29:35 -06:00
Родитель e20d40f925
Коммит 9f0ac136b2
2 изменённых файлов: 44 добавлений и 0 удалений

Просмотреть файл

@ -5706,6 +5706,32 @@ JS_SetErrorReporter(JSContext *cx, JSErrorReporter er)
/************************************************************************/
/*
* Dates.
*/
JS_PUBLIC_API(JSObject *)
JS_NewDateObject(JSContext *cx, int y, int m, int d, int h, int m, int s)
{
CHECK_REQUEST(cx);
return js_NewDateObject(cx, y, m, d, h, m, s);
}
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 y, int m, int d, int h, int m, int s);
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.
*/