case XULTREEELEMENT_CURRENTITEM: { PRBool ok = PR_FALSE; secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULTREEELEMENT_CURRENTITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_SECURITY_ERR); } nsIDOMXULElement* prop; nsresult result = NS_OK; result = a->GetCurrentItem(&prop); if (NS_SUCCEEDED(result)) {  nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); } else { return nsJSUtils::nsReportError(cx, obj, result); } break; } case XULTREEELEMENT_CURRENTCELL: { PRBool ok = PR_FALSE; secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULTREEELEMENT_CURRENTCELL, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_SECURITY_ERR); } nsIDOMXULElement* prop; nsresult result = NS_OK; result = a->GetCurrentCell(&prop); if (NS_SUCCEEDED(result)) {  nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); } else { return nsJSUtils::nsReportError(cx, obj, result); } break; }
GetXULTreeElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp){  nsIDOMXULTreeElement *a = (nsIDOMXULTreeElement*)nsJSUtils::nsGetNativeThis(cx, obj);  // If there's no private data, this must be the prototype, so ignore  if (nsnull == a) {    return JS_TRUE;  }  if (JSVAL_IS_INT(id)) {    nsresult rv;    NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,                    NS_SCRIPTSECURITYMANAGER_PROGID, &rv);    if (NS_FAILED(rv)) {      return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_SECMAN_ERR);    }    switch(JSVAL_TO_INT(id)) {      case XULTREEELEMENT_SELECTEDITEMS:      {        PRBool ok = PR_FALSE;        secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULTREEELEMENT_SELECTEDITEMS, PR_FALSE, &ok);        if (!ok) {          return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_SECURITY_ERR);        }        nsIDOMNodeList* prop;        nsresult result = NS_OK;        result = a->GetSelectedItems(&prop);        if (NS_SUCCEEDED(result)) {          // get the js object          nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp);        }        else {          return nsJSUtils::nsReportError(cx, obj, result);        }        break;      }      case XULTREEELEMENT_SELECTEDCELLS:      {        PRBool ok = PR_FALSE;        secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULTREEELEMENT_SELECTEDCELLS, PR_FALSE, &ok);        if (!ok) {          return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_SECURITY_ERR);        }        nsIDOMNodeList* prop;        nsresult result = NS_OK;        result = a->GetSelectedCells(&prop);        if (NS_SUCCEEDED(result)) {          // get the js object          nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp);        }        else {          return nsJSUtils::nsReportError(cx, obj, result);        }        break;      }      default:        return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, obj, id, vp);    }  }  else {    return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, obj, id, vp);  }  return PR_TRUE;}