diff --git a/js/src/jsapi.c b/js/src/jsapi.c index b66cf8a2ae96..cac3188ef04c 100644 --- a/js/src/jsapi.c +++ b/js/src/jsapi.c @@ -69,6 +69,7 @@ #include "jsscope.h" #include "jsscript.h" #include "jsstr.h" +#include "prmjtime.h" #if JS_HAS_FILE_OBJECT #include "jsfile.h" @@ -86,6 +87,12 @@ #define CHECK_REQUEST(cx) ((void)0) #endif +JS_PUBLIC_API(int64) +JS_Now() +{ + return PRMJ_Now(); +} + JS_PUBLIC_API(jsval) JS_GetNaNValue(JSContext *cx) { diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 2bba779f7749..f5ca65bb4690 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -140,6 +140,13 @@ JS_BEGIN_EXTERN_C #define JSVAL_FALSE BOOLEAN_TO_JSVAL(JS_FALSE) #define JSVAL_TRUE BOOLEAN_TO_JSVAL(JS_TRUE) +/* + * Microseconds since the epoch, midnight, January 1, 1970 UTC. See the + * comment in jstypes.h regarding safe int64 usage. + */ +extern JS_PUBLIC_API(int64) +JS_Now(); + /* Don't want to export data, so provide accessors for non-inline jsvals. */ extern JS_PUBLIC_API(jsval) JS_GetNaNValue(JSContext *cx); diff --git a/js/src/jsdbgapi.c b/js/src/jsdbgapi.c index 431cfa4715f3..45dd22e9f6ba 100644 --- a/js/src/jsdbgapi.c +++ b/js/src/jsdbgapi.c @@ -714,6 +714,12 @@ JS_GetScriptLineExtent(JSContext *cx, JSScript *script) return js_GetScriptLineExtent(script); } +JS_PUBLIC_API(JSVersion) +JS_GetScriptVersion(JSContext *cx, JSScript *script) +{ + return script->version; +} + /***************************************************************************/ JS_PUBLIC_API(void) diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h index 14ecedca88aa..35fcb24434a8 100644 --- a/js/src/jsdbgapi.h +++ b/js/src/jsdbgapi.h @@ -190,6 +190,9 @@ JS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script); extern JS_PUBLIC_API(uintN) JS_GetScriptLineExtent(JSContext *cx, JSScript *script); +extern JS_PUBLIC_API(JSVersion) +JS_GetScriptVersion(JSContext *cx, JSScript *script); + /************************************************************************/ /*