*vp = OBJECT_TO_JSVAL(nsIRDFDataSource::GetJSObject(cx, DataSource)); NS_RELEASE(DataSource);
*vp = DataSource ? OBJECT_TO_JSVAL(nsIRDFDataSource::GetJSObject(cx, DataSource)) : 0; NS_IF_RELEASE(DataSource);
nsIRDFCursor_GetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp){  if (!JSVAL_IS_INT(id))    return JS_TRUE;  nsresult result;  nsIRDFCursor *priv = (nsIRDFCursor *)JS_GetPrivate(cx, obj);  if (!priv)    return JS_TRUE;  switch (JSVAL_TO_INT(id)) {   case -1:    nsIRDFDataSource * DataSource;    result = priv->GetDataSource(&DataSource);    if (NS_FAILED(result))      goto bad;    *vp = OBJECT_TO_JSVAL(nsIRDFDataSource::GetJSObject(cx, DataSource));    NS_RELEASE(DataSource);    break;   case -2:    nsIRDFNode * Value;    result = priv->GetValue(&Value);    if (NS_FAILED(result))      goto bad;    *vp = OBJECT_TO_JSVAL(nsIRDFNode::GetJSObject(cx, Value));    NS_RELEASE(Value);    break;  }  return JS_TRUE;bad:  JS_ReportError(cx, XXXnsresult2string(result));  return JS_FALSE;}