Bug 1065185 - Create a content Array rather than a chrome array when reading Icc contacts. r=hsinyi
☠☠ backed out by 5c14c63b4c1a ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Wed, 01 Oct 2014 15:25:01 +0200
changeset 208203 54d6077015dae167ca4f38ba2a2eee9cb6de6763
parent 208202 e2528549de9de753470749e3684a241e75443a11
child 208204 fbdb5bead63939509d4f2d920ead0ac67bdcec60
push id27580
push userkwierso@gmail.com
push dateWed, 01 Oct 2014 23:26:55 +0000
treeherderautoland@af6c928893c0 [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);