Bug 1065185 - Create a content Array rather than a chrome array when reading Icc contacts. r=hsinyi

Right now, this array gets implicit __exposedProps__ for all of its indexed
members (and .length). Instead, we should be creating the Array directly in
the target Window.
This commit is contained in:
Bobby Holley 2014-10-01 15:25:01 +02:00
parent 5eaf64ea01
commit 3b2e1a3754

View File

@ -799,7 +799,8 @@ RILContentHelper.prototype = {
let window = this._windowsMap[message.requestId];
delete this._windowsMap[message.requestId];
let contacts = message.contacts;
let result = contacts.map(function(c) {
let result = new window.Array();
contacts.forEach(function(c) {
let prop = {name: [c.alphaId], tel: [{value: c.number}]};
if (c.email) {
@ -814,7 +815,7 @@ RILContentHelper.prototype = {
let contact = new window.mozContact(prop);
contact.id = c.contactId;
return contact;
result.push(contact);
});
this.fireRequestSuccess(message.requestId, result);