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-03 10:05:51 +02:00
Родитель f4c38cee30
Коммит 6e48726329
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -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);