*vp = OBJECT_TO_JSVAL(nsIRDFResource::GetJSObject(cx, Resource)); NS_RELEASE(Resource);
*vp = Resource ? OBJECT_TO_JSVAL(nsIRDFResource::GetJSObject(cx, Resource)) : 0; NS_IF_RELEASE(Resource);
nsIRDFResourceCursor_GetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp){  if (!JSVAL_IS_INT(id))    return JS_TRUE;  nsresult result;  nsIRDFResourceCursor *priv = (nsIRDFResourceCursor *)JS_GetPrivate(cx, obj);  if (!priv)    return JS_TRUE;  switch (JSVAL_TO_INT(id)) {   case -1:    nsIRDFResource * Resource;    result = priv->GetResource(&Resource);    if (NS_FAILED(result))      goto bad;    *vp = OBJECT_TO_JSVAL(nsIRDFResource::GetJSObject(cx, Resource));    NS_RELEASE(Resource);    break;  }  return JS_TRUE;bad:  JS_ReportError(cx, XXXnsresult2string(result));  return JS_FALSE;}