Bug 1065185 - Create a content Array rather than a chrome array when reading Icc contacts. r=hsinyi
authorBobby Holley <bobbyholley@gmail.com>
Fri, 03 Oct 2014 10:05:51 +0200
changeset 231757 2bf5d8b7d3cbdab894449291273b49bde3c133b7
parent 231756 34dbc25304b9357942a337297b5bb9c0626ede76
child 231758 674d025b67e946580a0f602a3be8ede799c0d5fb
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1065185
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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.
dom/system/gonk/RILContentHelper.js
--- a/dom/system/gonk/RILContentHelper.js
+++ b/dom/system/gonk/RILContentHelper.js
@@ -794,32 +794,33 @@ RILContentHelper.prototype = {
     if (message.errorMsg) {
       this.fireRequestError(message.requestId, message.errorMsg);
       return;
     }
 
     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) {
         prop.email = [{value: c.email}];
       }
 
       // ANR - Additional Number
       let anrLen = c.anr ? c.anr.length : 0;
       for (let i = 0; i < anrLen; i++) {
         prop.tel.push({value: c.anr[i]});
       }
 
       let contact = new window.mozContact(prop);
       contact.id = c.contactId;
-      return contact;
+      result.push(contact);
     });
 
     this.fireRequestSuccess(message.requestId, result);
   },
 
   handleUpdateIccContact: function(message) {
     if (message.errorMsg) {
       this.fireRequestError(message.requestId, message.errorMsg);