diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 36f702b827a9..df9992ea5762 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -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. */ diff --git a/js/src/jsapi.h b/js/src/jsapi.h index e07eb4268bec..3667560abb82 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -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. */