Bug 927079: Avoid for-of syntax until stable and fast. r=gwagner
authorBen Kelly <ben@wanderview.com>
Fri, 18 Oct 2013 03:50:33 -0300
changeset 166100 fe28224ef7193714374c6f7c7c514500b6a66691
parent 166099 62c49e2095d330e807b3b1a856463051707721ec
child 166101 e337dc39645fab0b0868f971db77fa244e3e9acc
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgwagner
bugs927079
milestone27.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 927079: Avoid for-of syntax until stable and fast. r=gwagner
dom/contacts/ContactManager.js
--- a/dom/contacts/ContactManager.js
+++ b/dom/contacts/ContactManager.js
@@ -174,18 +174,18 @@ function validateArrayField(data, create
       }
       return target[name];
     }
   };
 
   if (data) {
     data = Array.isArray(data) ? data : [data];
     let filtered = [];
-    for (let obj of data) {
-      filtered.push(createCb(obj));
+    for (let i = 0, n = data.length; i < n; ++i) {
+      filtered.push(createCb(data[i]));
     }
     if (filtered.length === 0) {
       return undefined;
     }
     return new Proxy(filtered, ArrayPropertyHandler);
   }
   return undefined;
 }