if (!nativeThis) return JS_FALSE;
InstallRegisterChrome(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){  // If there's no private data, this must be the prototype, so ignore  nsInstall *nativeThis =    (nsInstall*)JS_GetInstancePrivate(cx, obj, &InstallClass, argv);  if (!nativeThis)    return JS_FALSE;  if (nsnull == nativeThis) {    *rval = INT_TO_JSVAL(nsInstall::UNEXPECTED_ERROR);    return JS_TRUE;  }  // Now validate the arguments  uint32 chromeType = 0;  nsIFile* chrome = nsnull;  if ( argc >=2 )  {    JS_ValueToECMAUint32(cx, argv[0], &chromeType);    if (argv[1] != JSVAL_NULL && JSVAL_IS_OBJECT(argv[1]))    {      JSObject* jsObj = JSVAL_TO_OBJECT(argv[1]);      if (JS_InstanceOf(cx, jsObj, &FileSpecObjectClass, nsnull))      {        nsInstallFolder* folder = (nsInstallFolder*)JS_GetPrivate(cx,jsObj);        if (folder)        {          chrome = folder->GetFileSpec();        }      }    }  }  nsAutoString path;  if (argc >= 3) {    ConvertJSValToStr(path, cx, argv[2]);  }  *rval = INT_TO_JSVAL(nativeThis->RegisterChrome(chrome, chromeType, NS_ConvertUCS2toUTF8(path).get()));  return JS_TRUE;}