else { JS_ReportError(cx, "Function RenameProfile requires 2 parameters"); return JS_FALSE; }
ProfileCoreRenameProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){  nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);  nsAutoString b0;  nsAutoString b1;  *rval = JSVAL_NULL;  nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);  nsIScriptSecurityManager *secMan;  if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {    return JS_FALSE;  }  {    PRBool ok;    secMan->CheckScriptAccess(scriptCX, obj, "profilecore.renameprofile", &ok);    if (!ok) {      //Need to throw error here      return JS_FALSE;    }    NS_RELEASE(secMan);  }  // If there's no private data, this must be the prototype, so ignore  if (nsnull == nativeThis) {    return JS_TRUE;  }  {    if (argc < 2) {      JS_ReportError(cx, "Function RenameProfile requires 2 parameters");      return JS_FALSE;    }    nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);    nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);    if (NS_OK != nativeThis->RenameProfile(b0, b1)) {      return JS_FALSE;    }    *rval = JSVAL_VOID;  }  return JS_TRUE;}