Add JS_GetObjectId, void cx->exception in JS_ClearPendingException (127418, r=shaver).

This commit is contained in:
brendan%mozilla.org 2003-12-22 06:10:51 +00:00
parent f96cd32219
commit f5b40a54ca
2 changed files with 16 additions and 0 deletions

View File

@ -2058,6 +2058,13 @@ JS_GetConstructor(JSContext *cx, JSObject *proto)
return JSVAL_TO_OBJECT(cval);
}
JS_PUBLIC_API(JSBool)
JS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp)
{
*idp = (jsid) obj;
return JS_TRUE;
}
JS_PUBLIC_API(JSObject *)
JS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent)
{
@ -4048,6 +4055,7 @@ JS_ClearPendingException(JSContext *cx)
{
#if JS_HAS_EXCEPTIONS
cx->throwing = JS_FALSE;
cx->exception = JSVAL_VOID;
#endif
}

View File

@ -907,6 +907,14 @@ JS_SetParent(JSContext *cx, JSObject *obj, JSObject *parent);
extern JS_PUBLIC_API(JSObject *)
JS_GetConstructor(JSContext *cx, JSObject *proto);
/*
* Get a unique identifier for obj, good for the lifetime of obj (even if it
* is moved by a copying GC). Return false on failure (likely out of memory),
* and true with *idp containing the unique id on success.
*/
extern JS_PUBLIC_API(JSBool)
JS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp);
extern JS_PUBLIC_API(JSObject *)
JS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);