JSObject *winRegPrototype     = nsnull; JSObject *winProfilePrototype = nsnull;
PRInt32 InitXPInstallObjects(JSContext *jscontext,                              JSObject *global,                              const char* jarfile,                              const PRUnichar* url,                             const PRUnichar* args){  JSObject *installObject       = nsnull;  nsInstall *nativeInstallObject;  installObject  = JS_InitClass( jscontext,         // context                                 global,            // global object                                 nsnull,            // parent proto                                  &InstallClass,     // JSClass                                 nsnull,            // JSNative ctor                                 0,                 // ctor args                                 nsnull,            // proto props                                 nsnull,            // proto funcs                                 InstallProperties, // ctor props (static)                                 InstallMethods);   // ctor funcs (static)  if (nsnull == installObject)   {      return NS_ERROR_FAILURE;  }  if ( PR_FALSE == JS_DefineConstDoubles(jscontext, installObject, install_constants) )            return NS_ERROR_FAILURE;    nativeInstallObject = new nsInstall();  nativeInstallObject->SetJarFileLocation(jarfile);  nativeInstallObject->SetInstallArguments(args);  nativeInstallObject->SetInstallURL(url);  JS_SetPrivate(jscontext, installObject, nativeInstallObject);  nativeInstallObject->SetScriptObject(installObject); #ifdef _WINDOWS  if(NS_OK != InitWinRegPrototype(jscontext, global, &winRegPrototype))  {      return NS_ERROR_FAILURE;  }  nativeInstallObject->SaveWinRegPrototype(winRegPrototype);  if(NS_OK != InitWinProfilePrototype(jscontext, global, &winRegPrototype))  {      return NS_ERROR_FAILURE;  }  nativeInstallObject->SaveWinProfilePrototype(winProfilePrototype);#endif   return NS_OK;}