if (table) JS_DHashTableRawRemove(table, entry);
if (resolving) JS_DHashTableOperate(table, &key, JS_DHASH_REMOVE);
InitFunctionAndObjectClasses(JSContext *cx, JSObject *obj){    JSDHashTable *table;    JSRuntime *rt;    JSResolvingKey key;    JSDHashEntryHdr *entry;    JSObject *fun_proto, *obj_proto;    /* If cx has no global object, use obj so prototypes can be found. */    if (!cx->globalObject)        cx->globalObject = obj;    /* Record both Function and Object in cx->resolving, if we are resolving. */    table = cx->resolving;    if (table) {        rt = cx->runtime;        key.obj = obj;        key.id = (jsid) rt->atomState.FunctionAtom;        entry = JS_DHashTableOperate(table, &key, JS_DHASH_LOOKUP);        if (JS_DHASH_ENTRY_IS_BUSY(entry))            key.id = (jsid) rt->atomState.ObjectAtom;        entry = JS_DHashTableOperate(table, &key, JS_DHASH_ADD);        if (!entry) {            JS_ReportOutOfMemory(cx);            return NULL;        }        ((JSResolvingEntry *)entry)->key = key;    }    /* Initialize the function class first so constructors can be made. */    fun_proto = js_InitFunctionClass(cx, obj);    if (!fun_proto)        return NULL;    /* Initialize the object class next so Object.prototype works. */    obj_proto = js_InitObjectClass(cx, obj);    if (!obj_proto)        return NULL;    /* Function.prototype and the global object delegate to Object.prototype. */    OBJ_SET_PROTO(cx, fun_proto, obj_proto);    if (!OBJ_GET_PROTO(cx, obj))        OBJ_SET_PROTO(cx, obj, obj_proto);    /* If resolving, remove the other entry (Object or Function) from table. */    if (table)        JS_DHashTableRawRemove(table, entry);    return fun_proto;}