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