Bug 783057 - Expose find results via XPCOM. r=gwagner

This commit is contained in:
Bobby Holley 2012-08-17 09:50:19 -07:00
Родитель 87cfe706d3
Коммит 9c0932a591
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -152,7 +152,10 @@ const CONTACT_CONTRACTID = "@mozilla.org/contact;1";
const CONTACT_CID = Components.ID("{da0f7040-388b-11e1-b86c-0800200c9a66}");
const nsIDOMContact = Components.interfaces.nsIDOMContact;
function Contact() { debug("Contact constr: "); };
// The wrappedJSObject magic here allows callers to get at the underlying JS object
// of the XPCOM component. We use this below to modify properties that are read-only
// per-idl. See https://developer.mozilla.org/en-US/docs/wrappedJSObject.
function Contact() { debug("Contact constr: "); this.wrappedJSObject = this; };
Contact.prototype = {
@ -319,9 +322,9 @@ ContactManager.prototype = {
_convertContactsArray: function(aContacts) {
let contacts = new Array();
for (let i in aContacts) {
let newContact = new Contact();
let newContact = Components.classes['@mozilla.org/contact;1'].createInstance();
newContact.init(aContacts[i].properties);
this._setMetaData(newContact, aContacts[i]);
this._setMetaData(newContact.wrappedJSObject, aContacts[i]);
contacts.push(newContact);
}
return contacts;