PRBool enabled = PR_FALSE; nativeThis->UpdateEnabled(&enabled); if (!enabled) return JS_TRUE;
InstallTriggerGlobalInstall(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){  nsIDOMInstallTriggerGlobal *nativeThis = (nsIDOMInstallTriggerGlobal*)JS_GetPrivate(cx, obj);  *rval = JSVAL_FALSE;  if (nsnull == nativeThis  &&  (JS_FALSE == CreateNativeObject(cx, obj, &nativeThis)) )    return JS_FALSE;  // parse associative array of installs  if ( argc >= 1 && JSVAL_IS_OBJECT(argv[0]) )  {    nsXPITriggerInfo *trigger = new nsXPITriggerInfo();    if (!trigger)      return JS_FALSE;    JSIdArray *ida = JS_Enumerate( cx, JSVAL_TO_OBJECT(argv[0]) );    if ( ida )     {      jsval v;      PRUnichar *name, *URL;      for (int i = 0; i < ida->length; i++ )      {        JS_IdToValue( cx, ida->vector[i], &v );        name = JS_GetStringChars( JS_ValueToString( cx, v ) );        JS_GetUCProperty( cx, JSVAL_TO_OBJECT(argv[0]), name, nsCRT::strlen(name), &v );        URL = JS_GetStringChars( JS_ValueToString( cx, v ) );        if ( name && URL )        {            nsXPITriggerItem *item = new nsXPITriggerItem( name, URL );            if ( item )                trigger->Add( item );            else                ; // XXX signal error somehow        }        else            ; // XXX need to signal error      }      JS_DestroyIdArray( cx, ida );    }    // save callback function if any (ignore bad args for now)    if ( argc >= 2 && JS_TypeOfValue(cx,argv[1]) == JSTYPE_FUNCTION )    {      trigger->SaveCallback( cx, argv[1] );    }    // pass on only if good stuff found    if (trigger->Size() > 0)    {        PRBool result;        nativeThis->Install(trigger,&result);        *rval = BOOLEAN_TO_JSVAL(result);        return JS_TRUE;    }    else        delete trigger;  }  JS_ReportError(cx, "Incorrect arguments to InstallTrigger.Install()");  return JS_FALSE;}