return JS_FALSE;
return nsJSUtils::nsReportError(cx, result);
GetXULElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp){  nsIDOMXULElement *a = (nsIDOMXULElement*)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)) {    nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);    nsCOMPtr<nsIScriptSecurityManager> secMan;    if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {      return JS_FALSE;    }    switch(JSVAL_TO_INT(id)) {      case XULELEMENT_ID:      {        PRBool ok = PR_FALSE;        secMan->CheckScriptAccess(scriptCX, obj, "xulelement.id", PR_FALSE, &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsAutoString prop;        if (NS_SUCCEEDED(a->GetId(prop))) {          nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case XULELEMENT_CLASSNAME:      {        PRBool ok = PR_FALSE;        secMan->CheckScriptAccess(scriptCX, obj, "xulelement.classname", PR_FALSE, &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsAutoString prop;        if (NS_SUCCEEDED(a->GetClassName(prop))) {          nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case XULELEMENT_STYLE:      {        PRBool ok = PR_FALSE;        secMan->CheckScriptAccess(scriptCX, obj, "xulelement.style", PR_FALSE, &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsIDOMCSSStyleDeclaration* prop;        if (NS_SUCCEEDED(a->GetStyle(&prop))) {          // get the js object          nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case XULELEMENT_DATABASE:      {        PRBool ok = PR_FALSE;        secMan->CheckScriptAccess(scriptCX, obj, "xulelement.database", PR_FALSE, &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsIRDFCompositeDataSource* prop;        if (NS_SUCCEEDED(a->GetDatabase(&prop))) {          // get the js object; n.b., this will do a release on 'prop'          nsJSUtils::nsConvertXPCObjectToJSVal(prop, nsIRDFCompositeDataSource::GetIID(), cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case XULELEMENT_RESOURCE:      {        PRBool ok = PR_FALSE;        secMan->CheckScriptAccess(scriptCX, obj, "xulelement.resource", PR_FALSE, &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsIRDFResource* prop;        if (NS_SUCCEEDED(a->GetResource(&prop))) {          // get the js object; n.b., this will do a release on 'prop'          nsJSUtils::nsConvertXPCObjectToJSVal(prop, nsIRDFResource::GetIID(), cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case XULELEMENT_CONTROLLER:      {        PRBool ok = PR_FALSE;        secMan->CheckScriptAccess(scriptCX, obj, "xulelement.controller", PR_FALSE, &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsIController* prop;        if (NS_SUCCEEDED(a->GetController(&prop))) {          // get the js object; n.b., this will do a release on 'prop'          nsJSUtils::nsConvertXPCObjectToJSVal(prop, nsIController::GetIID(), cx, vp);        }        else {          return JS_FALSE;        }        break;      }      default:        return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);    }  }  else {    return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);  }  return PR_TRUE;}