rem:  editCard = new Object;   var prefs = Components.classes["@mozilla.org/preferences;1"]; if ( prefs ) { prefs = prefs.getService(); if ( prefs ) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); editCard.prefs = prefs; } }   if ( prefs ) { try { editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration"); editCard.lastFirstSeparator = ", "; editCard.firstLastSeparator = " "; } catch (ex) { dump("failed to get pref\n"); } } 
add:  editCard = new Object;   var prefs = Components.classes["@mozilla.org/preferences;1"]; if ( prefs ) { prefs = prefs.getService(); if ( prefs ) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); editCard.prefs = prefs; } }   if ( prefs ) { try { editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration"); editCard.lastFirstSeparator = ", "; editCard.firstLastSeparator = " "; } catch (ex) { dump("failed to get pref\n"); } } 
context: function InitEditCard(){  gAddressBookBundle = document.getElementById("bundle_addressBook");	// create editCard object that contains global variables for editCard.js	editCard = new Object;		// get pointer to nsIPref object	var prefs = Components.classes["@mozilla.org/preferences;1"];	if ( prefs )	{		prefs = prefs.getService();		if ( prefs )		{			prefs = prefs.QueryInterface(Components.interfaces.nsIPref);			editCard.prefs = prefs;		}	}				// get specific prefs that editCard will need	if ( prefs )	{		try {			editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.displayName.lastnamefirst");			editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration");			editCard.lastFirstSeparator = ", ";			editCard.firstLastSeparator = " ";		}		catch (ex) {			dump("failed to get pref\n");		}	}}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/0b2dd2b2d2fd037df917e07645fa019a963332a5/abCardOverlay.js/clean/mailnews/addrbook/resources/content/abCardOverlay.js