JSObject *pobj; JSScopeProperty *sprop;
FindConstructor(JSContext *cx, JSObject *scope, const char *name, jsval *vp){    JSAtom *atom;    JSObject *obj;    JSObject *pobj;    JSScopeProperty *sprop;    atom = js_Atomize(cx, name, strlen(name), 0);    if (!atom)        return JS_FALSE;    if (scope || (cx->fp && (scope = cx->fp->scopeChain) != NULL)) {        /* Find the topmost object in the scope chain. */        do {            obj = scope;            scope = OBJ_GET_PARENT(cx, obj);        } while (scope);    } else {        obj = cx->globalObject;        if (!obj) {            *vp = JSVAL_VOID;            return JS_TRUE;        }    }    if (!OBJ_LOOKUP_PROPERTY(cx, obj, (jsid)atom, &pobj, (JSProperty**)&sprop))        return JS_FALSE;    if (!sprop)  {        *vp = JSVAL_VOID;        return JS_TRUE;    }    JS_ASSERT(OBJ_IS_NATIVE(pobj));    JS_ASSERT(SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(pobj)));    *vp = OBJ_GET_SLOT(cx, pobj, sprop->slot);    OBJ_DROP_PROPERTY(cx, pobj, (JSProperty *)sprop);    return JS_TRUE;}