зеркало из https://github.com/mozilla/gecko-dev.git
Bug 783057 - Expose find results via XPCOM. r=gwagner
This commit is contained in:
Родитель
87cfe706d3
Коммит
9c0932a591
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче