зеркало из https://github.com/mozilla/gecko-dev.git
Add JS_NewDateObject, JS_NewDateObjectMsec, JS_ObjectIsDate to the JSAPI. r=jorendorff, a=shaver.
This commit is contained in:
Родитель
e20d40f925
Коммит
9f0ac136b2
|
@ -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.
|
* 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.
|
* Regular Expressions.
|
||||||
*/
|
*/
|
||||||
|
|
Загрузка…
Ссылка в новой задаче